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