Add GitHub Pages deployment and consolidate release uploads

- Upload build outputs as workflow artifacts (windows/macos/linux)
- Add upload-to-release job that consolidates all platform uploads
- Add publish-to-pages job that deploys to GitHub Pages
- Add required permissions for Pages deployment

Build artifacts are now available in two places:
- GitHub Release for manual downloads
- GitHub Pages /update/ for auto-update systems

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Henrik Bruhn 2025-12-11 13:06:43 +01:00
parent a60f9c801f
commit 6a53f86aea

View file

@ -9,6 +9,8 @@ on:
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
pages: write
id-token: write
jobs: jobs:
draft-release: draft-release:
@ -55,30 +57,74 @@ jobs:
- name: Package and make - name: Package and make
run: npm run make run: npm run make
- name: Upload Windows assets - name: Upload Windows artifacts
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
shell: bash uses: actions/upload-artifact@v4
run: | with:
for file in out/make/squirrel.windows/x64/*; do name: windows-artifacts
gh release upload ${{ needs.draft-release.outputs.tag-name }} "$file" --clobber path: out/make/squirrel.windows/x64/*
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload macOS assets - name: Upload macOS artifacts
if: matrix.os == 'macos-latest' if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: macos-artifacts
path: |
out/make/zip/darwin/**/*.zip
out/make/zip/darwin/**/*RELEASES.json
out/make/*.dmg
- name: Upload Linux artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: linux-artifacts
path: |
out/make/rpm/x64/*.rpm
out/make/deb/x64/*.deb
out/make/AppImage/x64/*.AppImage
upload-to-release:
name: Upload to GitHub Release
needs: [draft-release, build-release]
if: needs.draft-release.outputs.tag-name != ''
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Upload all assets to release
run: | run: |
for file in out/make/zip/darwin/**/*.zip out/make/zip/darwin/**/*RELEASES.json out/make/*.dmg; do find artifacts -type f -exec gh release upload ${{ needs.draft-release.outputs.tag-name }} {} --clobber \;
gh release upload ${{ needs.draft-release.outputs.tag-name }} "$file" --clobber
done
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Linux assets publish-to-pages:
if: matrix.os == 'ubuntu-latest' name: Publish to GitHub Pages
run: | needs: [draft-release, build-release]
for file in out/make/rpm/x64/*.rpm out/make/deb/x64/*.deb out/make/AppImage/x64/*.AppImage; do if: needs.draft-release.outputs.tag-name != ''
gh release upload ${{ needs.draft-release.outputs.tag-name }} "$file" --clobber runs-on: ubuntu-latest
done environment:
env: name: github-pages
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: update
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'update'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4