Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/test-determine-binary-name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ jobs:
expected-name: my-binary.exe
expected-name-with-arch: my-binary-x86_64-pc-windows-msvc.exe
expected-suffix: x86_64-pc-windows-msvc
- image: macos-latest
- image: macos-26-intel
expected-name: my-binary
expected-name-with-arch: my-binary-x86_64-apple-darwin
expected-suffix: x86_64-apple-darwin
- image: macos-26
expected-name: my-binary
expected-name-with-arch: my-binary-aarch64-apple-darwin
expected-suffix: aarch64-apple-darwin
runs-on: ${{ matrix.os.image }}
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -54,10 +58,14 @@ jobs:
expected-name: program.exe
expected-name-with-arch: program-windows.exe
expected-suffix: windows
- image: macos-latest
- image: macos-26-intel
expected-name: program
expected-name-with-arch: program-macos
expected-suffix: macos
- image: macos-26
expected-name: program
expected-name-with-arch: program-macos-arm
expected-suffix: macos-arm
runs-on: ${{ matrix.os.image }}
steps:
- uses: actions/checkout@v6
Expand All @@ -68,6 +76,7 @@ jobs:
linux-suffix: linux
windows-suffix: windows
macos-suffix: macos
macos-arm-suffix: macos-arm
- uses: armakuni/github-actions/assert-equals@v0.19.14
name: Check name
with:
Expand Down
2 changes: 1 addition & 1 deletion cache-cargo-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A simple wrapper around actions/cache configured with common Cargo
runs:
using: composite
steps:
- uses: actions/cache@v4
- uses: actions/cache@v5
name: Cache cargo dependencies
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
Expand Down
21 changes: 19 additions & 2 deletions determine-binary-name/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ inputs:
required: false
default: x86_64-unknown-linux-gnu
macos-suffix:
description: The suffix to add to Linux binaries
description: The suffix to add to macOS binaries
required: false
default: x86_64-apple-darwin
macos-arm-suffix:
description: The suffix to add to macOS ARM binaries
required: false
default: aarch64-apple-darwin

outputs:
name:
Expand All @@ -39,9 +43,12 @@ runs:
WINDOWS_SUFFIX: ${{ inputs.windows-suffix }}
LINUX_SUFFIX: ${{ inputs.linux-suffix }}
MACOS_SUFFIX: ${{ inputs.macos-suffix }}
MACOS_ARM_SUFFIX: ${{ inputs.macos-arm-suffix }}
run: |
set -euo pipefail

echo "RUNNER_OS=$RUNNER_OS"

if [ "$RUNNER_OS" == "Linux" ]; then
suffix="$LINUX_SUFFIX"
target_file="$FILENAME"
Expand All @@ -51,15 +58,25 @@ runs:
target_file="$FILENAME.exe"
source_file="$FILENAME-$suffix.exe"
elif [ "$RUNNER_OS" == "macOS" ]; then
suffix="$MACOS_SUFFIX"
echo "\$(uname -m)=$(uname -m)"
if [ "$(uname -m)" == "arm64" ]; then
suffix="$MACOS_ARM_SUFFIX"
else
suffix="$MACOS_SUFFIX"
fi
target_file="$FILENAME"
source_file="$FILENAME-$suffix"
else
echo "$RUNNER_OS not supported"
exit 1
fi

echo "name-with-arch=$source_file"
echo "name-with-arch=$source_file" >> "$GITHUB_OUTPUT"

echo "name=$target_file"
echo "name=$target_file" >> "$GITHUB_OUTPUT"

echo "suffix=$suffix"
echo "suffix=$suffix" >> "$GITHUB_OUTPUT"
shell: bash
Loading