diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 2f57f5da8..e1df2b24b 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -17,6 +17,8 @@ jobs: - goarch: arm64 goos: windows steps: + - name: Install dependencies + run: sudo apt-get update && sudo apt-get -y install apt-utils gcc-aarch64-linux-gnu - uses: actions/checkout@v3 - name: Codebase security check continue-on-error: true @@ -25,6 +27,13 @@ jobs: go-version: '1.20' env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + - name: Set CC environment variable for cross-compilation + run: | + if [ "${{ matrix.goarch }}" = "arm64" ]; then + echo "::set-env name=CC::aarch64-linux-gnu-gcc" + elif [ "${{ matrix.goarch }}" = "amd64" ]; then + echo "::set-env name=CC::x86_64-linux-gnu-gcc" + fi - uses: wangyoucao577/go-release-action@v1.40 env: MIXPANEL_PROJECT_TOKEN: ${{ secrets.MIXPANEL_PROJECT_TOKEN }} @@ -33,6 +42,8 @@ jobs: BUILD_TIME: $(date --iso-8601=seconds) VERSION: ${{github.ref_name}} COMMIT: ${{ github.sha }} + CGO_ENABLED: 1 + CGO_FLAGS: "-O2 -D__BLST_PORTABLE__" with: pre_command: make generate github_token: ${{ secrets.GITHUB_TOKEN }}