Skip to content

Commit 53aa249

Browse files
Publish Linux binaries as .tar.gz (#9568)
1 parent 08958c9 commit 53aa249

1 file changed

Lines changed: 36 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,18 @@ jobs:
236236
Compress-Archive -Path (Get-Item publish/nitro.exe) -DestinationPath nitro-${{ matrix.rid }}.zip
237237
shell: pwsh
238238

239-
- name: 📦 Zip binary (Unix)
240-
if: runner.os != 'Windows'
239+
- name: 📦 Zip binary (macOS)
240+
if: runner.os == 'macOS'
241241
run: |
242242
zip -j nitro-${{ matrix.rid }}.zip publish/nitro
243243
shell: bash
244244

245+
- name: 📦 Tar binary (Linux)
246+
if: runner.os == 'Linux'
247+
run: |
248+
tar -czf nitro-${{ matrix.rid }}.tar.gz -C publish nitro
249+
shell: bash
250+
245251
- name: 🖋️ Notarize binary (macOS)
246252
if: runner.os == 'macOS'
247253
env:
@@ -277,16 +283,16 @@ jobs:
277283
run: |
278284
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
279285
280-
- name: 📤 Upload zipped binary as artifact
286+
- name: 📤 Upload packaged binary as artifact
281287
uses: actions/upload-artifact@v7
282288
with:
283289
name: nitro-${{ matrix.rid }}
284-
path: nitro-${{ matrix.rid }}.zip
290+
path: nitro-${{ matrix.rid }}.${{ runner.os == 'Linux' && 'tar.gz' || 'zip' }}
285291

286-
- name: 📤 Attach zipped binary to GitHub release
292+
- name: 📤 Attach packaged binary to GitHub release
287293
shell: bash
288294
run: |
289-
gh release upload ${{ github.ref_name }} nitro-${{ matrix.rid }}.zip --repo ${{ github.repository }}
295+
gh release upload ${{ github.ref_name }} nitro-${{ matrix.rid }}.${{ runner.os == 'Linux' && 'tar.gz' || 'zip' }} --repo ${{ github.repository }}
290296
env:
291297
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
292298

@@ -313,12 +319,12 @@ jobs:
313319
- name: 🧰 Enable corepack
314320
run: corepack enable
315321

316-
- name: 📥 Download all zipped nitro binaries
322+
- name: 📥 Download all packaged nitro binaries
317323
uses: actions/download-artifact@v8
318324
with:
319325
pattern: nitro-*
320326
merge-multiple: true
321-
path: dist-zips
327+
path: dist-archives
322328

323329
- name: 🏷 Get the version from tag
324330
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
@@ -327,13 +333,28 @@ jobs:
327333
run: |
328334
PACKAGE_DIR="src/Nitro/CommandLine/src/chillicream-nitro"
329335
330-
for z in dist-zips/nitro-*.zip; do
331-
name=$(basename "$z" .zip) # e.g. nitro-linux-x64
332-
rid=${name#nitro-} # e.g. linux-x64
333-
334-
echo "Unpacking $z -> $PACKAGE_DIR/$rid"
335-
mkdir -p "$PACKAGE_DIR/$rid"
336-
unzip -q "$z" -d "$PACKAGE_DIR/$rid"
336+
for archive in dist-archives/nitro-*; do
337+
base=$(basename "$archive")
338+
339+
case "$base" in
340+
nitro-*.zip)
341+
rid=${base#nitro-}
342+
rid=${rid%.zip}
343+
echo "Unpacking $archive -> $PACKAGE_DIR/$rid"
344+
mkdir -p "$PACKAGE_DIR/$rid"
345+
unzip -q "$archive" -d "$PACKAGE_DIR/$rid"
346+
;;
347+
nitro-*.tar.gz)
348+
rid=${base#nitro-}
349+
rid=${rid%.tar.gz}
350+
echo "Unpacking $archive -> $PACKAGE_DIR/$rid"
351+
mkdir -p "$PACKAGE_DIR/$rid"
352+
tar -xzf "$archive" -C "$PACKAGE_DIR/$rid"
353+
;;
354+
*)
355+
echo "Skipping unknown artifact: $archive"
356+
;;
357+
esac
337358
done
338359
339360
# Ensure unix binaries are executable

0 commit comments

Comments
 (0)