From 238ed095a392ce8f7226938ea9b24350c9e8df7e Mon Sep 17 00:00:00 2001 From: Eli Peter <54954007+ecpeter23@users.noreply.github.com> Date: Wed, 25 Jun 2025 02:49:09 +0200 Subject: [PATCH] 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> --- .github/workflows/release-build.yml | 29 ++++++++++++++++++++++------- CHANGELOG.MD | 5 +++++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 5c2ca654..3d76a73b 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -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" + + # PowerShell’s 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: diff --git a/CHANGELOG.MD b/CHANGELOG.MD index c7f73847..932240b5 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed +- Fixed a bug in the release pipeline where Windows was trying to call the zip, PowerShell doesn't have a zip command + ## [0.1.1] - 2025-06-25 ### Fixed