From 49f480d3460d2afbaef0462b9028d996b7a0225c Mon Sep 17 00:00:00 2001 From: overtrue Date: Tue, 8 Jul 2025 20:21:11 +0800 Subject: [PATCH] fix: resolve GitHub Actions build failures and optimize cross-compilation - Remove invalid github-token parameter from arduino/setup-protoc action - Fix cross-compilation RUSTFLAGS issue by conditionally setting target-cpu=native - Update workflow tag triggers from v* to * for non-v prefixed tags - Optimize Zig and cargo-zigbuild installation using official actions This resolves build failures in aarch64-unknown-linux-musl target where zig was receiving invalid x86_64 CPU flags during cross-compilation. --- .github/actions/setup/action.yml | 1 - .github/workflows/build.yml | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 623ee73e..af8e758a 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -72,7 +72,6 @@ runs: uses: arduino/setup-protoc@v3 with: version: "31.1" - github-token: ${{ inputs.github-token }} - name: Install flatc uses: Nugine/setup-flatc@v1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d11d77c..84bb9d97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,6 @@ env: RUST_BACKTRACE: 1 # Optimize build performance CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-C target-cpu=native" jobs: # First layer: GitHub Actions level optimization (handling duplicates and concurrency) @@ -108,6 +107,8 @@ jobs: if: needs.skip-duplicate.outputs.should_skip != 'true' && needs.build-check.outputs.should_build == 'true' runs-on: ${{ matrix.os }} timeout-minutes: 60 + env: + RUSTFLAGS: ${{ matrix.cross == 'false' && '-C target-cpu=native' || '' }} strategy: fail-fast: false matrix: