Skip to content

Commit 2e85850

Browse files
committed
ci: fix base64 decode for macOS BSD compatibility (-D instead of -d)
1 parent 9b6cfae commit 2e85850

2 files changed

Lines changed: 28 additions & 16 deletions

File tree

.github/workflows/manual-sdk-release-artifacts.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ jobs:
6969
HASHES_WINDOWS: ${{ steps.release-sdk.outputs.hashes-windows }}
7070
HASHES_MACOS: ${{ steps.release-sdk.outputs.hashes-macos }}
7171
run: |
72+
# BSD base64 (macOS) uses -D to decode; GNU base64 (Linux/Windows) uses -d.
73+
if [[ "$OSTYPE" == darwin* ]]; then B64_DECODE="base64 -D"; else B64_DECODE="base64 -d"; fi
7274
if [ -n "${HASHES_LINUX}" ]; then
73-
echo "${HASHES_LINUX}" | base64 -d > checksums.txt
75+
echo "${HASHES_LINUX}" | $B64_DECODE > checksums.txt
7476
elif [ -n "${HASHES_WINDOWS}" ]; then
75-
echo "${HASHES_WINDOWS}" | base64 -d > checksums.txt
77+
echo "${HASHES_WINDOWS}" | $B64_DECODE > checksums.txt
7678
elif [ -n "${HASHES_MACOS}" ]; then
77-
echo "${HASHES_MACOS}" | base64 -d > checksums.txt
79+
echo "${HASHES_MACOS}" | $B64_DECODE > checksums.txt
7880
fi
7981
shell: bash
8082
- name: Attest build provenance
@@ -106,7 +108,8 @@ jobs:
106108
env:
107109
HASHES: ${{ steps.release-sdk.outputs.hashes-macos }}
108110
run: |
109-
echo "${HASHES}" | base64 -d > checksums.txt
111+
# This job always runs on macOS, so use -D (BSD base64 decode).
112+
echo "${HASHES}" | base64 -D > checksums.txt
110113
shell: bash
111114
- name: Attest build provenance
112115
uses: actions/attest@v4

.github/workflows/release-please.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,14 @@ jobs:
119119
HASHES_WINDOWS: ${{ steps.release-client.outputs.hashes-windows }}
120120
HASHES_MACOS: ${{ steps.release-client.outputs.hashes-macos }}
121121
run: |
122+
# BSD base64 (macOS) uses -D to decode; GNU base64 (Linux/Windows) uses -d.
123+
if [[ "$OSTYPE" == darwin* ]]; then B64_DECODE="base64 -D"; else B64_DECODE="base64 -d"; fi
122124
if [ -n "${HASHES_LINUX}" ]; then
123-
echo "${HASHES_LINUX}" | base64 -d > checksums.txt
125+
echo "${HASHES_LINUX}" | $B64_DECODE > checksums.txt
124126
elif [ -n "${HASHES_WINDOWS}" ]; then
125-
echo "${HASHES_WINDOWS}" | base64 -d > checksums.txt
127+
echo "${HASHES_WINDOWS}" | $B64_DECODE > checksums.txt
126128
elif [ -n "${HASHES_MACOS}" ]; then
127-
echo "${HASHES_MACOS}" | base64 -d > checksums.txt
129+
echo "${HASHES_MACOS}" | $B64_DECODE > checksums.txt
128130
fi
129131
shell: bash
130132
- name: Attest build provenance
@@ -156,7 +158,8 @@ jobs:
156158
env:
157159
HASHES: ${{ steps.release-client.outputs.hashes-macos }}
158160
run: |
159-
echo "${HASHES}" | base64 -d > checksums.txt
161+
# This job always runs on macOS, so use -D (BSD base64 decode).
162+
echo "${HASHES}" | base64 -D > checksums.txt
160163
shell: bash
161164
- name: Attest build provenance
162165
uses: actions/attest@v4
@@ -193,12 +196,14 @@ jobs:
193196
HASHES_WINDOWS: ${{ steps.release-server.outputs.hashes-windows }}
194197
HASHES_MACOS: ${{ steps.release-server.outputs.hashes-macos }}
195198
run: |
199+
# BSD base64 (macOS) uses -D to decode; GNU base64 (Linux/Windows) uses -d.
200+
if [[ "$OSTYPE" == darwin* ]]; then B64_DECODE="base64 -D"; else B64_DECODE="base64 -d"; fi
196201
if [ -n "${HASHES_LINUX}" ]; then
197-
echo "${HASHES_LINUX}" | base64 -d > checksums.txt
202+
echo "${HASHES_LINUX}" | $B64_DECODE > checksums.txt
198203
elif [ -n "${HASHES_WINDOWS}" ]; then
199-
echo "${HASHES_WINDOWS}" | base64 -d > checksums.txt
204+
echo "${HASHES_WINDOWS}" | $B64_DECODE > checksums.txt
200205
elif [ -n "${HASHES_MACOS}" ]; then
201-
echo "${HASHES_MACOS}" | base64 -d > checksums.txt
206+
echo "${HASHES_MACOS}" | $B64_DECODE > checksums.txt
202207
fi
203208
shell: bash
204209
- name: Attest build provenance
@@ -230,7 +235,8 @@ jobs:
230235
env:
231236
HASHES: ${{ steps.release-server.outputs.hashes-macos }}
232237
run: |
233-
echo "${HASHES}" | base64 -d > checksums.txt
238+
# This job always runs on macOS, so use -D (BSD base64 decode).
239+
echo "${HASHES}" | base64 -D > checksums.txt
234240
shell: bash
235241
- name: Attest build provenance
236242
uses: actions/attest@v4
@@ -267,12 +273,14 @@ jobs:
267273
HASHES_WINDOWS: ${{ steps.release-server-redis.outputs.hashes-windows }}
268274
HASHES_MACOS: ${{ steps.release-server-redis.outputs.hashes-macos }}
269275
run: |
276+
# BSD base64 (macOS) uses -D to decode; GNU base64 (Linux/Windows) uses -d.
277+
if [[ "$OSTYPE" == darwin* ]]; then B64_DECODE="base64 -D"; else B64_DECODE="base64 -d"; fi
270278
if [ -n "${HASHES_LINUX}" ]; then
271-
echo "${HASHES_LINUX}" | base64 -d > checksums.txt
279+
echo "${HASHES_LINUX}" | $B64_DECODE > checksums.txt
272280
elif [ -n "${HASHES_WINDOWS}" ]; then
273-
echo "${HASHES_WINDOWS}" | base64 -d > checksums.txt
281+
echo "${HASHES_WINDOWS}" | $B64_DECODE > checksums.txt
274282
elif [ -n "${HASHES_MACOS}" ]; then
275-
echo "${HASHES_MACOS}" | base64 -d > checksums.txt
283+
echo "${HASHES_MACOS}" | $B64_DECODE > checksums.txt
276284
fi
277285
shell: bash
278286
- name: Attest build provenance
@@ -304,7 +312,8 @@ jobs:
304312
env:
305313
HASHES: ${{ steps.release-server-redis.outputs.hashes-macos }}
306314
run: |
307-
echo "${HASHES}" | base64 -d > checksums.txt
315+
# This job always runs on macOS, so use -D (BSD base64 decode).
316+
echo "${HASHES}" | base64 -D > checksums.txt
308317
shell: bash
309318
- name: Attest build provenance
310319
uses: actions/attest@v4

0 commit comments

Comments
 (0)