Skip to content

Release

Release #29

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g. 0.2.0)"
required: true
type: string
permissions:
contents: write
jobs:
ci:
uses: ./.github/workflows/ci.yml
release:
needs: ci
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASE_PAT }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Set version
id: version
run: |
npm version ${{ github.event.inputs.version }} --no-git-tag-version --allow-same-version
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Commit version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git diff --cached --quiet || git commit -m "Bump version to ${{ steps.version.outputs.version }}"
git push
- name: Install dependencies
run: npm ci
- name: Setup Python for node-gyp
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install setuptools for node-gyp
run: python -m pip install setuptools
- name: Build
run: npm run build
- name: Package and publish
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx electron-builder --mac --arm64 --publish always
- name: Add release notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="v${{ steps.version.outputs.version }}"
NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes \
-f tag_name="$TAG" \
--jq '.body')
gh release edit "$TAG" --notes "$NOTES"