From 7ff29401dbe72f89eca32f5f8e7caf6f987f8cc0 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Mon, 19 Feb 2024 17:14:48 +0800 Subject: [PATCH] Problem: cross-compiling macos binaries is problematic in recent nixpkgs Solution: - use the github macos-14 arm mac runner to build arm mac binaries --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 10 +++++++--- scripts/release.sh | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8d1b2f036..3ea8267815 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, macos-14] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2af34340f3..8c04205fee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,10 @@ jobs: release-macos: # runs sequentially to avoid creating duplicated release needs: ["release"] - runs-on: macos-latest + strategy: + matrix: + runner: [macos-latest, macos-14] + runs-on: ${{ matrix.runner }} environment: release steps: - uses: actions/checkout@v3 @@ -86,10 +89,11 @@ jobs: done # update checksum and upload - sha256sum *.tar.gz > "checksums-darwin.txt" + CHKFILE="checksums-darwin-$(uname -p).txt" + sha256sum *.tar.gz > "$CHKFILE" echo 'FILES<> $GITHUB_ENV ls -1 *.tar.gz >> $GITHUB_ENV - echo "checksums-darwin.txt" >> $GITHUB_ENV + echo "$CHKFILE" >> $GITHUB_ENV echo 'EOF' >> $GITHUB_ENV cat $GITHUB_ENV - name: upload binaries diff --git a/scripts/release.sh b/scripts/release.sh index 9b50bebdc7..e427656977 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -37,7 +37,9 @@ if [[ "$build_platform" == "x86_64-linux" ]]; then elif [[ "$build_platform" == "aarch64-linux" ]]; then hosts="Linux_arm64,native Linux_x86_64,gnu64 Windows_x86_64,mingwW64" elif [[ "$build_platform" == "x86_64-darwin" ]]; then - hosts="Darwin_x86_64,native Darwin_arm64,aarch64-darwin" + hosts="Darwin_x86_64,native" +elif [[ "$build_platform" == "aarch64-darwin" ]]; then + hosts="Darwin_arm64,native" else echo "don't support build platform: $build_platform" exit 1