Build Release Installer #3
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
| name: Build Release Installer | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: {} | |
| jobs: | |
| build-installer: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore | |
| run: dotnet restore ./ScreenshotSweeper.csproj | |
| - name: Publish (win-x64) | |
| run: | | |
| dotnet publish ./ScreenshotSweeper.csproj -c Release -r win-x64 --self-contained false -p:PublishTrimmed=false -o bin\Release\net8.0-windows10.0.19041.0\win-x64\publish | |
| - name: Install Inno Setup (via Chocolatey) | |
| run: choco install innosetup -y | |
| - name: Build installer (Inno Setup) | |
| run: '"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" Setup.iss' | |
| - name: List installer output | |
| run: dir Installer | |
| - name: Find installer | |
| id: find_installer | |
| shell: pwsh | |
| run: | | |
| $f = Get-ChildItem -Path Installer -Filter *.exe | Select-Object -First 1 | |
| if (-not $f) { Write-Error 'No installer executable found in Installer\'; exit 1 } | |
| Write-Host "Found installer: $($f.Name)" | |
| echo "installer_path=Installer\$($f.Name)" >> $GITHUB_OUTPUT | |
| echo "installer_name=$($f.Name)" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| release_name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload installer to release | |
| uses: actions/upload-release-asset@v1 | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: ${{ steps.find_installer.outputs.installer_path }} | |
| asset_name: ${{ steps.find_installer.outputs.installer_name }} | |
| asset_content_type: application/octet-stream |