Skip to content

Commit dc599fb

Browse files
ci: validate arch input in macOS Nix native build
Co-authored-by: Codesmith <[email protected]>
1 parent 4a717d2 commit dc599fb

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

  • .github/actions/build-macos-nix-native-package

‎.github/actions/build-macos-nix-native-package/action.yaml‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ runs:
1919
run: |
2020
# arm64 builds natively; x64 cross-compiles on this same arm64 runner
2121
# (the Apple SDK is multi-arch), so no separate Intel runner is needed.
22-
if [ "$ARCH" = "x64" ]; then
23-
nix build .#ccusage-darwin-x64 --print-build-logs
24-
else
25-
nix build .#ccusage --print-build-logs
26-
fi
22+
case "$ARCH" in
23+
x64)
24+
nix build .#ccusage-darwin-x64 --print-build-logs
25+
;;
26+
arm64)
27+
nix build .#ccusage --print-build-logs
28+
;;
29+
*)
30+
echo "Unsupported arch: $ARCH" >&2
31+
exit 1
32+
;;
33+
esac
2734
2835
- name: Stage native package
2936
shell: bash

0 commit comments

Comments
 (0)