Windows package #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Builds dist/windows-package, zips it, compiles Inno Setup, uploads artifacts. | |
| # On published release: attaches windows-package.zip and FinancialOverview-Windows-Setup.exe to that release. | |
| name: Windows package | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| package: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout (release tag when applicable) | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| - name: Build Windows package folder | |
| shell: pwsh | |
| env: | |
| CI: "true" | |
| PUPPETEER_SKIP_DOWNLOAD: "true" | |
| run: npm run windows:package | |
| - name: Zip windows-package | |
| shell: pwsh | |
| run: | | |
| if (Test-Path dist/windows-package.zip) { Remove-Item dist/windows-package.zip -Force } | |
| Compress-Archive -Path dist/windows-package -DestinationPath dist/windows-package.zip -CompressionLevel Optimal | |
| - name: Install Inno Setup | |
| shell: pwsh | |
| run: choco install innosetup -y --no-progress | |
| - name: Compile installer (Inno Setup) | |
| shell: pwsh | |
| run: | | |
| $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" | |
| if (-not (Test-Path $iscc)) { $iscc = "${env:ProgramFiles}\Inno Setup 6\ISCC.exe" } | |
| if (-not (Test-Path $iscc)) { throw "ISCC.exe not found after Inno Setup install" } | |
| & $iscc packaging/windows/FinancialOverview.iss | |
| - name: Verify outputs | |
| shell: pwsh | |
| run: | | |
| Get-Item dist/windows-package.zip, dist/FinancialOverview-Windows-Setup.exe | Format-Table Name, Length | |
| - name: Upload workflow artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-release-assets | |
| path: | | |
| dist/windows-package.zip | |
| dist/FinancialOverview-Windows-Setup.exe | |
| if-no-files-found: error | |
| - name: Upload assets to GitHub Release | |
| if: github.event_name == 'release' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| shell: pwsh | |
| run: | | |
| gh release upload "${{ github.event.release.tag_name }}" ` | |
| "dist/windows-package.zip" ` | |
| "dist/FinancialOverview-Windows-Setup.exe" ` | |
| --clobber |