Fix electron-builder publish schema error; auto-publish release via g… #5
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 | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install frontend dependencies | |
| working-directory: frontend | |
| run: npm ci | |
| - name: Install app dependencies | |
| working-directory: app | |
| run: npm ci | |
| - name: Run tests | |
| run: | | |
| npm --prefix frontend test | |
| npm --prefix app test | |
| - name: Build and publish | |
| working-directory: app | |
| run: npm run build:all && npx electron-builder --publish always | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| # electron-builder always creates the GitHub release as a draft (its | |
| # config schema doesn't accept "draft: false" as of this app's last | |
| # update) — un-draft it here once every platform has finished | |
| # uploading, so the tag doesn't need a manual "Publish release" click. | |
| - name: Publish the release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release edit "${{ github.ref_name }}" --repo "${{ github.repository }}" --draft=false |