Merge pull request #2 from mikey0000/claude/release-builds-windows-li… #1
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: Release builds | |
| # Builds self-contained desktop bundles (see packaging/README.md): | |
| # Windows: Slopsmith-Setup-<ver>.exe (Inno Setup) + portable .zip | |
| # Linux: slopsmith_<ver>_amd64.deb + portable .tar.gz | |
| # | |
| # Runs on every v* tag (publishes a GitHub Release) and on manual dispatch | |
| # (uploads workflow artifacts only — useful for testing the pipeline). | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: 'stable' | |
| - name: Install vgmstream build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| build-essential cmake pkg-config yasm \ | |
| libmpg123-dev libvorbis-dev libspeex-dev libopus-dev | |
| - name: Build bundle | |
| id: bundle | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python3 packaging/build.py --platform linux-x64 | |
| - name: Smoke-test bundle | |
| run: | | |
| BUNDLE="${{ steps.bundle.outputs.bundle_dir }}" | |
| SLOPSMITH_NO_BROWSER=1 "$BUNDLE/slopsmith" -port 8123 & | |
| LAUNCHER_PID=$! | |
| for i in $(seq 1 60); do | |
| if curl -fsS http://127.0.0.1:8123/api/version; then ok=1; break; fi | |
| sleep 2 | |
| done | |
| [ "${ok:-}" = "1" ] || { echo '::error::bundle failed to serve /api/version'; kill $LAUNCHER_PID || true; exit 1; } | |
| kill $LAUNCHER_PID | |
| - name: Package .tar.gz and .deb | |
| run: | | |
| BUNDLE="${{ steps.bundle.outputs.bundle_dir }}" | |
| VERSION="${{ steps.bundle.outputs.version }}" | |
| mkdir -p release-assets | |
| tar -C "$(dirname "$BUNDLE")" -czf "release-assets/Slopsmith-${VERSION}-linux-x64.tar.gz" "$(basename "$BUNDLE")" | |
| bash packaging/linux/build_deb.sh "$BUNDLE" "$VERSION" release-assets | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x64 | |
| path: release-assets/* | |
| if-no-files-found: error | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: 'stable' | |
| - name: Build bundle | |
| id: bundle | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python packaging/build.py --platform windows-x64 | |
| - name: Smoke-test bundle | |
| shell: pwsh | |
| run: | | |
| $bundle = "${{ steps.bundle.outputs.bundle_dir }}" | |
| $env:SLOPSMITH_NO_BROWSER = "1" | |
| $proc = Start-Process -FilePath "$bundle\Slopsmith.exe" -ArgumentList "-port","8123" -PassThru -NoNewWindow | |
| $ok = $false | |
| foreach ($i in 1..60) { | |
| try { | |
| Invoke-RestMethod -Uri "http://127.0.0.1:8123/api/version" -TimeoutSec 2 | ConvertTo-Json | |
| $ok = $true; break | |
| } catch { Start-Sleep -Seconds 2 } | |
| } | |
| Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue | |
| # Stop the python child too if it survived the launcher. | |
| Get-Process python -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue | |
| if (-not $ok) { Write-Error "bundle failed to serve /api/version" } | |
| - name: Package portable .zip | |
| shell: pwsh | |
| run: | | |
| $bundle = "${{ steps.bundle.outputs.bundle_dir }}" | |
| $version = "${{ steps.bundle.outputs.version }}" | |
| New-Item -ItemType Directory -Force -Path release-assets | Out-Null | |
| Compress-Archive -Path $bundle -DestinationPath "release-assets/Slopsmith-$version-windows-x64.zip" | |
| - name: Build installer (Inno Setup) | |
| shell: pwsh | |
| run: | | |
| $bundle = "${{ steps.bundle.outputs.bundle_dir }}" | |
| $version = "${{ steps.bundle.outputs.version }}" | |
| $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" | |
| if (-not (Test-Path $iscc)) { choco install innosetup -y --no-progress; $iscc = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" } | |
| & $iscc "/DAppVersion=$version" "/DBundleDir=$bundle" "/DOutputDir=$PWD\release-assets" packaging\windows\installer.iss | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-x64 | |
| path: release-assets/* | |
| if-no-files-found: error | |
| release: | |
| needs: [build-linux, build-windows] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: assets | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| cd assets | |
| sha256sum * > SHA256SUMS.txt | |
| cat SHA256SUMS.txt | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: assets/* | |
| generate_release_notes: true | |
| draft: false |