Build Windows Release Asset #6
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
| name: Build Windows Release Asset | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Release tag to update (e.g. v0.2.0-beta6)" | |
| required: true | |
| default: "v0.2.0-beta6" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-upload: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install FFmpeg | |
| shell: powershell | |
| run: | | |
| choco install ffmpeg -y | |
| ffmpeg -version | |
| - name: Install Python dependencies | |
| shell: powershell | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Build Windows app | |
| shell: powershell | |
| run: | | |
| pyinstaller --clean -y VinylFlow.spec | |
| - name: Package unsigned Windows app | |
| shell: powershell | |
| run: | | |
| if (Test-Path VinylFlow-windows-unsigned.zip) { Remove-Item VinylFlow-windows-unsigned.zip -Force } | |
| Compress-Archive -Path dist\VinylFlow\* -DestinationPath VinylFlow-windows-unsigned.zip | |
| Get-Item VinylFlow-windows-unsigned.zip | Format-List Name,Length,LastWriteTime | |
| - name: Replace release asset | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| shell: powershell | |
| run: | | |
| gh release upload ${{ inputs.tag }} VinylFlow-windows-unsigned.zip --clobber | |
| $release = gh release view ${{ inputs.tag }} --json assets | ConvertFrom-Json | |
| $asset = $release.assets | Where-Object { $_.name -eq 'VinylFlow-windows-unsigned.zip' } | |
| $asset | Select-Object name,size,updatedAt,url | Format-List |