mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 02:13:41 +00:00
- Organize files in correct directory structure for auto-updater - Windows files → update/win32/x64/ - macOS files → update/darwin/arm64/ (ZIP + RELEASES.json only) - Fix macOS update manifest URL from x64 to arm64 - Exclude Linux packages and macOS DMG (not used for auto-updates) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
143 lines
3.8 KiB
YAML
143 lines
3.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
draft-release:
|
|
name: Draft Release
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
release-id: ${{ steps.drafter.outputs.id }}
|
|
tag-name: ${{ steps.drafter.outputs.tag_name }}
|
|
version: ${{ steps.drafter.outputs.resolved_version }}
|
|
steps:
|
|
- name: Draft release
|
|
id: drafter
|
|
uses: release-drafter/release-drafter@v5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-release:
|
|
name: Build Release - ${{ matrix.os }}
|
|
needs: draft-release
|
|
if: needs.draft-release.outputs.tag-name != ''
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Update package.json version
|
|
run: |
|
|
npm version ${{ needs.draft-release.outputs.version }} --no-git-tag-version
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Package and make
|
|
run: npm run make
|
|
|
|
- name: Upload Windows artifacts
|
|
if: matrix.os == 'windows-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: windows-artifacts
|
|
path: out/make/squirrel.windows/x64/*
|
|
|
|
- name: Upload macOS artifacts
|
|
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: |
|
|
find artifacts -type f -exec gh release upload ${{ needs.draft-release.outputs.tag-name }} {} --clobber \;
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish-to-pages:
|
|
name: Publish to GitHub Pages
|
|
needs: [draft-release, build-release]
|
|
if: needs.draft-release.outputs.tag-name != ''
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
steps:
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Organize files for auto-update
|
|
run: |
|
|
# Create update directory structure
|
|
mkdir -p update/win32/x64
|
|
mkdir -p update/darwin/arm64
|
|
|
|
# Copy Windows auto-update files
|
|
cp artifacts/windows-artifacts/* update/win32/x64/
|
|
|
|
# Copy macOS auto-update files (only ZIP and RELEASES.json, not DMG)
|
|
cp artifacts/macos-artifacts/zip/darwin/arm64/*.zip update/darwin/arm64/
|
|
cp artifacts/macos-artifacts/zip/darwin/arm64/RELEASES.json update/darwin/arm64/
|
|
|
|
- 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
|