Skip to content

Commit f197aa6

Browse files
authored
Merge pull request #25 from tomphp/add-arm-support
feat: add ARM support for linux
2 parents e47f929 + 467544c commit f197aa6

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ jobs:
1010
expected-name: my-binary
1111
expected-name-with-arch: my-binary-x86_64-unknown-linux-gnu
1212
expected-suffix: x86_64-unknown-linux-gnu
13+
- image: ubuntu-24.04-arm
14+
expected-name: my-binary
15+
expected-name-with-arch: my-binary-aarch64-unknown-linux-gnu
16+
expected-suffix: aarch64-unknown-linux-gnu
1317
- image: windows-latest
1418
expected-name: my-binary.exe
1519
expected-name-with-arch: my-binary-x86_64-pc-windows-msvc.exe
@@ -54,6 +58,10 @@ jobs:
5458
expected-name: program
5559
expected-name-with-arch: program-linux
5660
expected-suffix: linux
61+
- image: ubuntu-24.04-arm
62+
expected-name: program
63+
expected-name-with-arch: program-linux-arm
64+
expected-suffix: linux-arm
5765
- image: windows-latest
5866
expected-name: program.exe
5967
expected-name-with-arch: program-windows.exe
@@ -74,6 +82,7 @@ jobs:
7482
with:
7583
name: program
7684
linux-suffix: linux
85+
linux-arm-suffix: linux-arm
7786
windows-suffix: windows
7887
macos-suffix: macos
7988
macos-arm-suffix: macos-arm

determine-binary-name/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ inputs:
2121
description: The suffix to add to macOS ARM binaries
2222
required: false
2323
default: aarch64-apple-darwin
24+
linux-arm-suffix:
25+
description: The suffix to add to Linux ARM binaries
26+
required: false
27+
default: aarch64-unknown-linux-gnu
2428

2529
outputs:
2630
name:
@@ -44,13 +48,19 @@ runs:
4448
LINUX_SUFFIX: ${{ inputs.linux-suffix }}
4549
MACOS_SUFFIX: ${{ inputs.macos-suffix }}
4650
MACOS_ARM_SUFFIX: ${{ inputs.macos-arm-suffix }}
51+
LINUX_ARM_SUFFIX: ${{ inputs.linux-arm-suffix }}
4752
run: |
4853
set -euo pipefail
4954
5055
echo "RUNNER_OS=$RUNNER_OS"
5156
5257
if [ "$RUNNER_OS" == "Linux" ]; then
53-
suffix="$LINUX_SUFFIX"
58+
echo "$(uname -m)=$(uname -m)"
59+
if [ "$(uname -m)" == "aarch64" ]; then
60+
suffix="$LINUX_ARM_SUFFIX"
61+
else
62+
suffix="$LINUX_SUFFIX"
63+
fi
5464
target_file="$FILENAME"
5565
source_file="$FILENAME-$suffix"
5666
elif [ "$RUNNER_OS" == "Windows" ]; then

0 commit comments

Comments
 (0)