Skip to content

Commit

Permalink
Problem: cross-compiling macos binaries is problematic in recent nixpkgs
Browse files Browse the repository at this point in the history
Solution:
- use the github macos-14 arm mac runner to build arm mac binaries
  • Loading branch information
yihuang committed Feb 19, 2024
1 parent 998b28b commit 7ff2940
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<<EOF' >> $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
Expand Down
4 changes: 3 additions & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ff2940

Please sign in to comment.