Fix/update release pipeline (#15)

* fix: Enhance release packaging for cross-platform compatibility

* fix: Resolve pipeline bug with zip command on Windows

* fix: Clarify changelog entry for Windows zip command issue in release pipeline

* Update CHANGELOG.MD

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Eli Peter 2025-06-25 02:49:09 +02:00 committed by GitHub
parent e221fdd7d6
commit 238ed095a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 7 deletions

View file

@ -48,7 +48,8 @@ jobs:
- name: Generate license bundle
run: cargo about generate about.hbs -o THIRDPARTY-LICENSES.html
- name: Package
- name: Package (Linux & macOS)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
@ -56,16 +57,30 @@ jobs:
TARGET=${{ matrix.target }}
EXT=$([[ "$TARGET" == *windows* ]] && echo ".exe" || echo "")
BIN_PATH=target/$TARGET/release/$BIN$EXT
if [[ ! -f "$BIN_PATH" ]]; then
echo "::error ::Binary $BIN_PATH not found"
ls -R target/$TARGET/release || true
exit 1
fi
mkdir -p dist
ARCHIVE=$BIN-$TARGET.zip
zip -9 "dist/$ARCHIVE" "$BIN_PATH" THIRDPARTY-LICENSES.html LICENSE* COPYING* || true
zip -9 "dist/$ARCHIVE" "$BIN_PATH" THIRDPARTY-LICENSES.html LICENSE* COPYING*
echo "ASSET=$ARCHIVE" >> "$GITHUB_ENV"
- name: Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$Bin = '${{ env.BIN_NAME }}'
$Target = '${{ matrix.target }}'
$Ext = '.exe'
$BinPath = "target/$Target/release/$Bin$Ext"
New-Item -ItemType Directory -Path dist -Force | Out-Null
$Archive = "$Bin-$Target.zip"
# PowerShells native ZIP
Compress-Archive `
-Path $BinPath, 'THIRDPARTY-LICENSES.html', 'LICENSE*', 'COPYING*' `
-DestinationPath "dist/$Archive" `
-CompressionLevel Optimal
Add-Content -Path $env:GITHUB_ENV -Value "ASSET=$Archive"
- name: Upload to the release
uses: softprops/action-gh-release@v2
with: