Skip to content

Commit 00bb723

Browse files
committed
feat: add macos arm to determine-binary-name
1 parent 437b02c commit 00bb723

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

.github/workflows/test-determine-binary-name.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ jobs:
1414
expected-name: my-binary.exe
1515
expected-name-with-arch: my-binary-x86_64-pc-windows-msvc.exe
1616
expected-suffix: x86_64-pc-windows-msvc
17-
- image: macos-latest
17+
- image: macos-26-intel
1818
expected-name: my-binary
1919
expected-name-with-arch: my-binary-x86_64-apple-darwin
2020
expected-suffix: x86_64-apple-darwin
21+
- image: macos-26
22+
expected-name: my-binary
23+
expected-name-with-arch: my-binary-aarch64-apple-darwin
24+
expected-suffix: aarch64-apple-darwin
2125
runs-on: ${{ matrix.os.image }}
2226
steps:
2327
- uses: actions/checkout@v6
@@ -54,10 +58,14 @@ jobs:
5458
expected-name: program.exe
5559
expected-name-with-arch: program-windows.exe
5660
expected-suffix: windows
57-
- image: macos-latest
61+
- image: macos-26-intel
5862
expected-name: program
5963
expected-name-with-arch: program-macos
6064
expected-suffix: macos
65+
- image: macos-26
66+
expected-name: program
67+
expected-name-with-arch: program-macos-arm
68+
expected-suffix: macos-arm
6169
runs-on: ${{ matrix.os.image }}
6270
steps:
6371
- uses: actions/checkout@v6
@@ -68,6 +76,7 @@ jobs:
6876
linux-suffix: linux
6977
windows-suffix: windows
7078
macos-suffix: macos
79+
macos-arm-suffix: macos-arm
7180
- uses: armakuni/github-actions/assert-equals@v0.19.14
7281
name: Check name
7382
with:

determine-binary-name/action.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ inputs:
1414
required: false
1515
default: x86_64-unknown-linux-gnu
1616
macos-suffix:
17-
description: The suffix to add to Linux binaries
17+
description: The suffix to add to macOS binaries
1818
required: false
1919
default: x86_64-apple-darwin
20+
macos-arm-suffix:
21+
description: The suffix to add to macOS ARM binaries
22+
required: false
23+
default: aarch64-apple-darwin
2024

2125
outputs:
2226
name:
@@ -39,9 +43,12 @@ runs:
3943
WINDOWS_SUFFIX: ${{ inputs.windows-suffix }}
4044
LINUX_SUFFIX: ${{ inputs.linux-suffix }}
4145
MACOS_SUFFIX: ${{ inputs.macos-suffix }}
46+
MACOS_ARM_SUFFIX: ${{ inputs.macos-arm-suffix }}
4247
run: |
4348
set -euo pipefail
4449
50+
echo "RUNNER_OS=$RUNNER_OS"
51+
4552
if [ "$RUNNER_OS" == "Linux" ]; then
4653
suffix="$LINUX_SUFFIX"
4754
target_file="$FILENAME"
@@ -51,15 +58,25 @@ runs:
5158
target_file="$FILENAME.exe"
5259
source_file="$FILENAME-$suffix.exe"
5360
elif [ "$RUNNER_OS" == "macOS" ]; then
54-
suffix="$MACOS_SUFFIX"
61+
echo "\$(uname -m)=$(uname -m)"
62+
if [ "$(uname -m)" == "arm64" ]; then
63+
suffix="$MACOS_ARM_SUFFIX"
64+
else
65+
suffix="$MACOS_SUFFIX"
66+
fi
5567
target_file="$FILENAME"
5668
source_file="$FILENAME-$suffix"
5769
else
5870
echo "$RUNNER_OS not supported"
5971
exit 1
6072
fi
6173
74+
echo "name-with-arch=$source_file"
6275
echo "name-with-arch=$source_file" >> "$GITHUB_OUTPUT"
76+
77+
echo "name=$target_file"
6378
echo "name=$target_file" >> "$GITHUB_OUTPUT"
79+
80+
echo "suffix=$suffix"
6481
echo "suffix=$suffix" >> "$GITHUB_OUTPUT"
6582
shell: bash

0 commit comments

Comments
 (0)