name: build on: push: branches: ["main"] pull_request: branches: ["main"] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: get_all_targets: name: Get all targets runs-on: ubuntu-latest outputs: TARGETS: ${{ steps.get_all_targets.outputs.TARGETS }} steps: - name: Checkout uses: actions/checkout@v4 - name: Get all targets id: get_all_targets run: | declare -a arr=() OIFS="$IFS" IFS=$'\n,' for line in $(BUILD_CONFIG=script/build.config.sh bash script/build.sh --show-all-platforms); do arr+=("$line") done IFS="$OIFS" printf -v json '"%s",' "${arr[@]}" json="[${json%,}]" echo "TARGETS=$json" >> $GITHUB_OUTPUT build: name: Build runs-on: ubuntu-latest needs: get_all_targets strategy: matrix: target: ${{ fromJson(needs.get_all_targets.outputs.TARGETS) }} steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 with: go-version: "1.22" - name: Build run: | BUILD_CONFIG=script/build.config.sh bash script/build.sh --skip-init-web --platforms="${{ matrix.target }}" --more-go-cmd-args='-a -v -x'