Release #4
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: | |
| workflow_run: | |
| workflows: [CI] | |
| types: [completed] | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| jobs: | |
| # ── Read version and create tag ──────────────────────── | |
| version: | |
| # Only run if CI passed and was triggered by a push (not a PR) | |
| if: > | |
| github.event.workflow_run.conclusion == 'success' && | |
| github.event.workflow_run.event == 'push' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.pkg.outputs.version }} | |
| tag: ${{ steps.pkg.outputs.tag }} | |
| exists: ${{ steps.check.outputs.exists }} | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| - name: Read version from package.json | |
| id: pkg | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "tag=v$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "Version: $VERSION" | |
| - name: Check if tag already exists | |
| id: check | |
| run: | | |
| if git ls-remote --tags origin "refs/tags/v${{ steps.pkg.outputs.version }}" | grep -q .; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| echo "Tag v${{ steps.pkg.outputs.version }} already exists, skipping release" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| echo "New version v${{ steps.pkg.outputs.version }}, will create release" | |
| fi | |
| # ── macOS (unsigned) ─────────────────────────────────── | |
| build-mac: | |
| needs: version | |
| if: needs.version.outputs.exists == 'false' | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - name: Build macOS DMG (unsigned) | |
| run: npm run build:mac | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CSC_IDENTITY_AUTO_DISCOVERY: false | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: mac-dmg | |
| path: dist-electron/*.dmg | |
| # ── Windows (unsigned) ──────────────────────────────── | |
| build-win: | |
| needs: version | |
| if: needs.version.outputs.exists == 'false' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - name: Build Windows EXE (unsigned) | |
| run: npm run build:win | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: win-exe | |
| path: dist-electron/*.exe | |
| # ── Linux ────────────────────────────────────────────── | |
| build-linux: | |
| needs: version | |
| if: needs.version.outputs.exists == 'false' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci | |
| - name: Build Linux AppImage | |
| run: npm run build:linux | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: linux-appimage | |
| path: dist-electron/*.AppImage | |
| # ── Create tag & GitHub Release ──────────────────────── | |
| release: | |
| needs: [version, build-mac, build-win, build-linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| - name: Create tag | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git tag -a "${{ needs.version.outputs.tag }}" -m "Release ${{ needs.version.outputs.tag }}" | |
| git push origin "${{ needs.version.outputs.tag }}" | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2 | |
| with: | |
| tag_name: ${{ needs.version.outputs.tag }} | |
| name: Slate ${{ needs.version.outputs.tag }} (unsigned) | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| body: | | |
| ## ⚠️ Unsigned builds | |
| These builds are **not code-signed**. Your OS may show a warning when installing. | |
| - **macOS**: Right-click → Open, then click Open in the dialog | |
| - **Windows**: Click "More info" → "Run anyway" | |
| - **Linux**: `chmod +x` the AppImage before running | |
| files: | | |
| artifacts/**/*.dmg | |
| artifacts/**/*.exe | |
| artifacts/**/*.AppImage |