diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 2c99fb2c2..d7226606b 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -25,7 +25,14 @@ jobs: go-version: '1.20' env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - - uses: wangyoucao577/go-release-action@v1.40 + - name: Determine C compiler + run: | + if [ "${{ matrix.goarch }}" = "arm64" ]; then; + echo "TARGET_CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + elif [ "${{ matrix.goarch }}" = "amd64" ]; then; + echo "TARGET_CC=x86_64-linux-gnu-gcc" >> $GITHUB_ENV + fi + - uses: wangyoucao577/go-release-action@v1.48 env: MIXPANEL_PROJECT_TOKEN: ${{ secrets.MIXPANEL_PROJECT_TOKEN }} LILICO_TOKEN: ${{ secrets.LILICO_TOKEN }} @@ -36,16 +43,11 @@ jobs: CGO_ENABLED: 1 CGO_FLAGS: "-O2 -D__BLST_PORTABLE__" with: - pre_command: | apt-get update && apt-get -y install gcc-aarch64-linux-gnu && make generate && - (if [ "${{ matrix.goarch }}" = "arm64" ]; then; - export CC=aarch64-linux-gnu-gcc - elif [ "${{ matrix.goarch }}" = "amd64" ]; then; - export CC=x86_64-linux-gnu-gcc - fi) + export CC="${TARGET_CC}" github_token: ${{ secrets.GITHUB_TOKEN }} goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }}