From 67bc43e997cedc59329ebf90eb4ea7478f30f569 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Sat, 9 May 2026 17:42:27 +0800 Subject: [PATCH] =?UTF-8?q?build(release):=20=E5=A2=9E=E5=8A=A0=20Windows?= =?UTF-8?q?=20=E7=BB=BF=E8=89=B2=E7=89=88=E5=8E=8B=E7=BC=A9=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b89607f6a..4e198f27d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,6 +121,31 @@ jobs: prerelease: false args: --target ${{ matrix.target }} + - name: Upload Windows portable ZIP + if: matrix.platform == 'windows-latest' + shell: pwsh + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $version = "${env:GITHUB_REF_NAME}".TrimStart("v") + $portableRoot = "portable" + $portableDir = Join-Path $portableRoot "DBX_${version}_x64" + $zipName = "DBX_${version}_x64-portable.zip" + $exePath = "target/${{ matrix.target }}/release/dbx.exe" + + if (!(Test-Path $exePath)) { + Write-Error "Missing Windows executable: $exePath" + exit 1 + } + + New-Item -ItemType Directory -Force -Path $portableDir | Out-Null + Copy-Item $exePath (Join-Path $portableDir "DBX.exe") -Force + Copy-Item "LICENSE" (Join-Path $portableDir "LICENSE") -Force + Copy-Item "README.md" (Join-Path $portableDir "README.md") -Force + + Compress-Archive -Path (Join-Path $portableDir "*") -DestinationPath $zipName -Force + gh release upload "${env:GITHUB_REF_NAME}" $zipName --repo "${env:GITHUB_REPOSITORY}" --clobber + publish: needs: [build, docker-manifest] runs-on: ubuntu-latest