From 67a2e753b3b0406c808d196298fbfc95a219ec5c Mon Sep 17 00:00:00 2001 From: elipeter Date: Mon, 1 Jun 2026 19:57:32 -0500 Subject: [PATCH] feat(build): enhance license file packaging logic and add Rust toolchain setup in docs workflow --- .github/workflows/docs.yml | 5 +++++ .github/workflows/release-build.yml | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fa5e86a2..bcc9b344 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,6 +25,11 @@ jobs: steps: - uses: actions/checkout@v6 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + cache: true + - name: Cache mdbook id: cache-mdbook uses: actions/cache@v5 diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 3447be1a..036f699f 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -110,7 +110,12 @@ jobs: BIN_PATH=target/$TARGET/release/$BIN$EXT mkdir -p dist ARCHIVE=$BIN-$TARGET.zip - zip -9 "dist/$ARCHIVE" "$BIN_PATH" THIRDPARTY-LICENSES.html LICENSE* COPYING* + files=("$BIN_PATH" THIRDPARTY-LICENSES.html) + shopt -s nullglob + license_files=(LICENSE* COPYING*) + shopt -u nullglob + files+=("${license_files[@]}") + zip -9 "dist/$ARCHIVE" "${files[@]}" echo "ASSET=$ARCHIVE" >> "$GITHUB_ENV" - name: Package (Windows) @@ -123,9 +128,11 @@ jobs: $BinPath = "target/$Target/release/$Bin$Ext" New-Item -ItemType Directory -Path dist -Force | Out-Null $Archive = "$Bin-$Target.zip" + $LicenseFiles = @(Get-ChildItem -Path 'LICENSE*', 'COPYING*' -File -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName }) + $Files = @($BinPath, 'THIRDPARTY-LICENSES.html') + $LicenseFiles Compress-Archive ` - -Path $BinPath, 'THIRDPARTY-LICENSES.html', 'LICENSE*', 'COPYING*' ` + -Path $Files ` -DestinationPath "dist/$Archive" ` -CompressionLevel Optimal