feat: add portable ZIP archives for Windows releases (#753)

* feat: add portable ZIP archives for Windows releases

Add portable (no-install) ZIP builds for Windows x64 and ARM64.
After the existing Tauri build step, a new step packages Handy.exe
and its resources/ directory into a zip archive that users can
extract and run directly without an installer.

The portable ZIPs are uploaded to GitHub Releases alongside the
existing NSIS/MSI installers, and included in CI artifact uploads.

Closes #153

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use -not instead of ! for PowerShell compatibility

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Shehab Tarek 2026-02-11 04:35:43 +02:00 committed by GitHub
parent c34e7d584b
commit 6f3fd9babc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -366,6 +366,61 @@ jobs:
src-tauri/target/${{ steps.build-profile.outputs.profile }}/bundle/rpm/*.rpm
retention-days: 30
- name: Create portable ZIP (Windows)
if: contains(inputs.platform, 'windows')
shell: pwsh
run: |
# Determine the target output directory
$target = "${{ inputs.target }}"
$profile = "${{ steps.build-profile.outputs.profile }}"
if ($target -eq "x86_64-pc-windows-msvc" -or $target -eq "") {
$targetDir = "src-tauri/target/$profile"
$arch = "x64"
} else {
$targetDir = "src-tauri/target/$target/$profile"
$arch = "arm64"
}
$version = "${{ steps.get-version.outputs.version }}"
$prefix = "${{ inputs.asset-prefix }}"
$zipName = "${prefix}_${version}_${arch}_portable.zip"
$stagingDir = "portable-staging/Handy_${version}_${arch}_portable"
# Create staging directory
New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null
# Copy the exe
$exePath = "$targetDir/Handy.exe"
if (-not (Test-Path $exePath)) {
Write-Error "Handy.exe not found at $exePath"
exit 1
}
Copy-Item $exePath $stagingDir/
# Copy the resources directory
$resourcesPath = "$targetDir/resources"
if (Test-Path $resourcesPath) {
Copy-Item -Recurse $resourcesPath "$stagingDir/resources"
} else {
Write-Warning "Resources directory not found at $resourcesPath"
}
# Create the zip
Compress-Archive -Path $stagingDir -DestinationPath $zipName
Write-Host "Created portable ZIP: $zipName"
echo "PORTABLE_ZIP_PATH=$zipName" >> $env:GITHUB_ENV
echo "PORTABLE_ZIP_NAME=$zipName" >> $env:GITHUB_ENV
- name: Upload portable ZIP to release (Windows)
if: contains(inputs.platform, 'windows') && inputs.release-id != ''
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "v${{ steps.get-version.outputs.version }}" "${{ env.PORTABLE_ZIP_PATH }}" \
--repo "${{ github.repository }}" \
--clobber
- name: Upload artifacts (Windows)
if: inputs.upload-artifacts && contains(inputs.platform, 'windows')
uses: actions/upload-artifact@v4
@ -375,4 +430,5 @@ jobs:
path: |
src-tauri/target/${{ inputs.target != '' && inputs.target != 'x86_64-pc-windows-msvc' && format('{0}/{1}', inputs.target, steps.build-profile.outputs.profile) || steps.build-profile.outputs.profile }}/bundle/msi/*.msi
src-tauri/target/${{ inputs.target != '' && inputs.target != 'x86_64-pc-windows-msvc' && format('{0}/{1}', inputs.target, steps.build-profile.outputs.profile) || steps.build-profile.outputs.profile }}/bundle/nsis/*.exe
${{ env.PORTABLE_ZIP_NAME }}
retention-days: 30