chore: bump version to 0.9.5 #39
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: package-desktop | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: package-desktop-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.value }} | |
| updates_url: ${{ steps.updates_url.outputs.value }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Check version sync | |
| run: ./scripts/check-version-sync.sh | |
| - name: Read VERSION | |
| id: version | |
| run: echo "value=$(cat VERSION)" >> "$GITHUB_OUTPUT" | |
| - name: Resolve update feed URL | |
| id: updates_url | |
| env: | |
| REPO: ${{ github.repository }} | |
| run: | | |
| owner="$(echo "${REPO}" | cut -d'/' -f1 | tr '[:upper:]' '[:lower:]')" | |
| repo_name="$(echo "${REPO}" | cut -d'/' -f2)" | |
| echo "value=https://${owner}.github.io/${repo_name}/updates/stable.json" >> "$GITHUB_OUTPUT" | |
| build-macos: | |
| runs-on: macos-latest | |
| needs: validate | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install frontend dependencies | |
| run: npm --prefix frontend ci | |
| - name: Build frontend assets | |
| env: | |
| VITE_UPDATES_URL: ${{ needs.validate.outputs.updates_url }} | |
| run: npm --prefix frontend run build | |
| - name: Verify frontend dist | |
| run: test -f frontend/dist/index.html | |
| - name: Install Wails CLI | |
| run: | | |
| go install github.com/wailsapp/wails/v2/cmd/wails@v2.10.2 | |
| echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" | |
| - name: Build macOS DMG | |
| env: | |
| VITE_UPDATES_URL: ${{ needs.validate.outputs.updates_url }} | |
| run: ./scripts/build-dmg.sh --version "${{ needs.validate.outputs.version }}" --clean | |
| - name: Upload macOS arm64 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pause-macos-arm64 | |
| path: build/bin/macos-arm64/*.dmg | |
| if-no-files-found: error | |
| retention-days: 14 | |
| - name: Upload macOS x64 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pause-macos-x64 | |
| path: build/bin/macos-x64/*.dmg | |
| if-no-files-found: error | |
| retention-days: 14 | |
| build-windows: | |
| runs-on: ubuntu-latest | |
| needs: validate | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install frontend dependencies | |
| run: npm --prefix frontend ci | |
| - name: Build frontend assets | |
| env: | |
| VITE_UPDATES_URL: ${{ needs.validate.outputs.updates_url }} | |
| run: npm --prefix frontend run build | |
| - name: Verify frontend dist | |
| run: test -f frontend/dist/index.html | |
| - name: Install Linux build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y nsis mingw-w64 | |
| - name: Install Wails CLI | |
| run: | | |
| go install github.com/wailsapp/wails/v2/cmd/wails@v2.10.2 | |
| echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" | |
| - name: Build Windows installer | |
| env: | |
| VITE_UPDATES_URL: ${{ needs.validate.outputs.updates_url }} | |
| run: ./scripts/build-windows-installer.sh --platform windows/amd64 --output-dir build/bin/windows-x64 --version "${{ needs.validate.outputs.version }}" --clean --no-portable-exe | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pause-windows-x64 | |
| path: build/bin/windows-x64/* | |
| if-no-files-found: error | |
| retention-days: 14 | |
| manifest: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - validate | |
| - build-macos | |
| - build-windows | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Download macOS arm64 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pause-macos-arm64 | |
| path: build/bin/macos-arm64 | |
| - name: Download macOS x64 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pause-macos-x64 | |
| path: build/bin/macos-x64 | |
| - name: Download Windows artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pause-windows-x64 | |
| path: build/bin/windows-x64 | |
| - name: Generate release manifest and checksums | |
| run: | | |
| ./scripts/generate-release-manifest.sh \ | |
| --version "${{ needs.validate.outputs.version }}" \ | |
| --channel "stable" \ | |
| --repo "${{ github.repository }}" \ | |
| --release-tag "v${{ needs.validate.outputs.version }}" | |
| - name: Upload release manifest | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pause-release-manifest | |
| path: build/bin/release/* | |
| if-no-files-found: error | |
| retention-days: 30 | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - validate | |
| - manifest | |
| - build-macos | |
| - build-windows | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Download macOS arm64 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pause-macos-arm64 | |
| path: build/bin/macos-arm64 | |
| - name: Download macOS x64 artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pause-macos-x64 | |
| path: build/bin/macos-x64 | |
| - name: Download Windows artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pause-windows-x64 | |
| path: build/bin/windows-x64 | |
| - name: Download release manifest | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pause-release-manifest | |
| path: build/bin/release | |
| - name: Render release notes | |
| env: | |
| VERSION: ${{ needs.validate.outputs.version }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| sed \ | |
| -e "s|VERSION|${VERSION}|g" \ | |
| -e "s|REPO|${REPO}|g" \ | |
| .github/release_template.md > release.md | |
| - name: Remove stale release assets | |
| uses: actions/github-script@v8 | |
| env: | |
| VERSION: ${{ needs.validate.outputs.version }} | |
| TAG_NAME: v${{ needs.validate.outputs.version }} | |
| with: | |
| script: | | |
| const owner = context.repo.owner; | |
| const repo = context.repo.repo; | |
| const tag = process.env.TAG_NAME; | |
| const version = process.env.VERSION; | |
| const keep = new Set([ | |
| `Pause-v${version}-macos-arm64.dmg`, | |
| `Pause-v${version}-macos-x64.dmg`, | |
| `Pause-v${version}-windows-x64-setup.exe`, | |
| 'release-manifest.txt', | |
| 'SHA256SUMS', | |
| 'updates.json', | |
| ]); | |
| let release; | |
| try { | |
| const response = await github.rest.repos.getReleaseByTag({ | |
| owner, | |
| repo, | |
| tag, | |
| }); | |
| release = response.data; | |
| } catch (error) { | |
| if (error.status === 404) { | |
| core.info(`No existing release found for ${tag}, skipping asset cleanup.`); | |
| return; | |
| } | |
| throw error; | |
| } | |
| for (const asset of release.assets ?? []) { | |
| if (keep.has(asset.name)) { | |
| core.info(`Keeping asset: ${asset.name}`); | |
| continue; | |
| } | |
| core.info(`Deleting stale asset: ${asset.name}`); | |
| await github.rest.repos.deleteReleaseAsset({ | |
| owner, | |
| repo, | |
| asset_id: asset.id, | |
| }); | |
| } | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| body_path: release.md | |
| files: | | |
| build/bin/macos-arm64/Pause-v${{ needs.validate.outputs.version }}-macos-arm64.dmg | |
| build/bin/macos-x64/Pause-v${{ needs.validate.outputs.version }}-macos-x64.dmg | |
| build/bin/windows-x64/Pause-v${{ needs.validate.outputs.version }}-windows-x64-setup.exe | |
| build/bin/release/release-manifest.txt | |
| build/bin/release/SHA256SUMS | |
| build/bin/release/updates.json | |
| deploy-updates-pages: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - validate | |
| - manifest | |
| - release | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Download release manifest | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pause-release-manifest | |
| path: build/bin/release | |
| - name: Prepare Pages content | |
| env: | |
| VERSION: ${{ needs.validate.outputs.version }} | |
| run: | | |
| mkdir -p .github/pages/updates | |
| cp build/bin/release/updates.json .github/pages/updates/stable.json | |
| sed -i "s/\${VERSION}/${VERSION}/g" .github/pages/index.html | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: .github/pages | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |