From 43701c093290d705f12e3ada31e86c06872e03ee Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Sat, 26 Oct 2024 01:10:47 +0800 Subject: [PATCH] test --- .github/workflows/build.yml | 46 +++++++++++++++---------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79075b2..e8b7000 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,36 +13,28 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - get_all_targets: + get-targets: name: Get all targets runs-on: ubuntu-latest outputs: - TARGETS: ${{ steps.get_all_targets.outputs.TARGETS }} + targets: ${{ steps.get-targets.outputs.targets }} steps: - - name: Checkout - uses: actions/checkout@v4 + - 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 + - name: Get All Targets + id: get-targets + uses: zijiren233/go-build-action@main + with: + show-all-targets: true + build-config: script/build.config.sh build: name: Build runs-on: ubuntu-latest - needs: get_all_targets + needs: get-targets strategy: matrix: - target: ${{ fromJson(needs.get_all_targets.outputs.TARGETS) }} + target: ${{ fromJson(needs.get-targets.outputs.targets) }} steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -63,14 +55,14 @@ jobs: with: go-version: "1.23" - - name: Build - run: | - BUILD_CONFIG=script/build.config.sh bash \ - script/build.sh \ - --enable-micro \ - --skip-init-web \ - --platforms="${{ matrix.target }}" \ - --more-go-cmd-args='-a -v' + - name: Build targets + uses: zijiren233/go-build-action@main + with: + targets: ${{ matrix.target }} + build-config: script/build.config.sh + enable-micro: true + more-go-cmd-args: "-a -v" + config-args: "--skip-init-web" - name: Get artifact name id: get_artifact_name