feat: build for aarch64-apple-darwin, closes #62

Build for aarch64-apple-darwin in the create_release.sh script, and the GitHub workflow action
This commit is contained in:
Jack Wills
2025-06-16 16:35:18 +00:00
parent 6edf99e084
commit e7114d2f5e
2 changed files with 28 additions and 4 deletions
+11 -1
View File
@@ -22,6 +22,9 @@ jobs:
- target: arm-unknown-linux-musleabihf
output_name: linux_armv6.tar.gz
- target: aarch64-apple-darwin
output_name: apple_darwin_aarch64.tar.gz
- target: x86_64-pc-windows-gnu
output_name: windows_x86_64.zip
@@ -38,8 +41,15 @@ jobs:
- name: install cross
run: cargo install cross --git https://github.com/cross-rs/cross
# Build binary
# Build binary for arm MacOS using Docker Zigbuild
- name: build
if: matrix.target == 'aarch64-apple-darwin'
run: |
docker run --rm -v $(pwd):/io -w /io ghcr.io/rust-cross/cargo-zigbuild cargo zigbuild --release --target aarch64-apple-darwin
# Build all other targets using Cross
- name: build
if: matrix.target != 'aarch64-apple-darwin'
run: cross build --target ${{ matrix.target }} --release
# Compress the output
+17 -3
View File
@@ -231,6 +231,13 @@ cross_build_x86_windows() {
cross build --target x86_64-pc-windows-gnu --release
}
# Build, using zig-build, for Apple silicon
zig_build_aarch64_apple() {
# mkdir /workspace/oxker/target
echo -e "${YELLOW}docker run --rm -v $(pwd):/io -w /io ghcr.io/rust-cross/cargo-zigbuild cargo zigbuild --release --target aarch64-apple-darwin${RESET}"
docker run --rm -v "$(pwd):/io" -w /io ghcr.io/rust-cross/cargo-zigbuild cargo zigbuild --release --target aarch64-apple-darwin
}
# Build all releases that GitHub workflow would
# This will download GB's of docker images
cross_build_all() {
@@ -243,6 +250,8 @@ cross_build_all() {
ask_continue
cross_build_x86_windows
ask_continue
zig_build_aarch64_apple
ask_continue
}
# $1 text to colourise
@@ -377,8 +386,9 @@ build_choice() {
1 "x86 musl linux" off
2 "aarch64 musl linux" off
3 "armv6 musl linux" off
4 "x86 windows" off
5 "all" off
4 "aarch64 apple" off
5 "x86 windows" off
6 "all" off
)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
exitStatus=$?
@@ -404,10 +414,14 @@ build_choice() {
exit
;;
4)
cross_build_x86_windows
zig_build_aarch64_apple
exit
;;
5)
cross_build_x86_windows
exit
;;
6)
cross_build_all
exit
;;