Skip to content

Commit a70fa6c

Browse files
committed
alpine: allow node20 for actions/cache@v4
1 parent 6976ebd commit a70fa6c

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/alpine/setup-node.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/sh
22

3-
[ -n "$1" ] || { echo "Usage: $0 <path>"; exit 1; }
4-
53
# A workaround for "JavaScript Actions in Alpine containers are only supported on x64 Linux runners."
64
# https://github.com/actions/runner/blob/8a9b96806d12343f7d123c669e29c629138023dd/src/Runner.Worker/Handlers/StepHost.cs#L283-L290
75
if [ "$(uname -m)" != "x86_64" ]; then
8-
mkdir -p $1
9-
ln -s /usr/bin/node $1
10-
ln -s /usr/bin/npm $1
6+
for node in /__e/node*; do
7+
mkdir -p $node/bin
8+
ln -s /usr/bin/node $node/bin/node
9+
ln -s /usr/bin/npm $node/bin/npm
10+
done
1111
sed -i 's/ID=alpine/ID=unknown/' /usr/lib/os-release
1212
fi

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
container:
3333
image: ghcr.io/getsentry/sentry-dotnet-alpine:3.21
3434
volumes:
35+
- /tmp/node20:/__e/node20
3536
- /tmp/node24:/__e/node24
3637
- os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
3738
rid: macos # universal (osx-arm64 + osx-x64)
@@ -44,7 +45,7 @@ jobs:
4445
- name: Initialize Alpine Linux
4546
if: ${{ contains(matrix.container.image, 'alpine') }}
4647
run: |
47-
curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin /__e/node24/bin/
48+
curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin
4849
4950
- name: Checkout
5051
uses: actions/checkout@v5
@@ -100,6 +101,7 @@ jobs:
100101
container:
101102
image: ghcr.io/getsentry/sentry-dotnet-alpine:3.21
102103
volumes:
104+
- /tmp/node20:/__e/node20
103105
- /tmp/node24:/__e/node24
104106
- /var/run/docker.sock:/var/run/docker.sock
105107
- os: macos-15 # Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
@@ -116,7 +118,7 @@ jobs:
116118
- name: Initialize Alpine Linux
117119
if: ${{ contains(matrix.container.image, 'alpine') }}
118120
run: |
119-
curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin /__e/node24/bin/
121+
curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin
120122
121123
- name: Cancel Previous Runs
122124
if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/')

0 commit comments

Comments
 (0)