Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Build/release

on: push

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-24.04
Expand All @@ -26,9 +29,19 @@ jobs:
needs: lint
runs-on: ${{ matrix.os }}

# Publishing uploads release assets with the workflow token.
permissions:
contents: write

strategy:
matrix:
os: [macos-15, ubuntu-24.04, windows-latest]
include:
- os: macos-15
platform: mac
- os: ubuntu-24.04
platform: linux
- os: windows-latest
platform: win

steps:
- name: Check out Git repository
Expand All @@ -45,19 +58,27 @@ jobs:
- name: Download binaries
run: npm run download-binaries

- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}

# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Build
run: yarn build
env:
SENTRY_URL: ${{ secrets.sentry_url }}
SENTRY_ORG: ${{ secrets.sentry_org }}
SENTRY_PROJECT: ${{ secrets.sentry_project }}
SENTRY_AUTH_TOKEN: ${{ secrets.sentry_auth_token }}

# Only a v* tag publishes; a macOS tag build fails without a signing certificate.
- name: Package and publish
shell: bash
# electron-builder reads an empty CSC_LINK on macOS as a certificate path, so drop it when the secret is missing.
run: |
[ -n "$CSC_LINK" ] || unset CSC_LINK CSC_KEY_PASSWORD
yarn electron-builder --${{ matrix.platform }} \
--publish ${{ startsWith(github.ref, 'refs/tags/v') && 'always' || 'never' }} \
${{ matrix.platform == 'mac' && startsWith(github.ref, 'refs/tags/v') && '-c.forceCodeSigning=true' || '' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_LINK: ${{ matrix.platform == 'mac' && secrets.mac_certs || '' }}
CSC_KEY_PASSWORD: ${{ matrix.platform == 'mac' && secrets.mac_certs_password || '' }}
# macOS notarization API key
APPLEID: ${{ secrets.apple_id }}
APPLEIDPASS: ${{ secrets.apple_id_pass }}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
},
"mac": {
"identity": "Johannes Klein (9VR92ZCXA8)",
"type": "distribution",
"notarize": false,
"mergeASARs": false,
"target": [
{
Expand Down
Loading