From 70821daf6ec340da1ef66d2c16b9c60da495c725 Mon Sep 17 00:00:00 2001 From: Johannes Klein Agents Date: Thu, 26 Nov 2026 11:33:09 +0100 Subject: [PATCH 1/2] Release job on plain electron-builder steps, publishing only from tags (#372) Replace samuelmeuli/action-electron-builder with `yarn build` and `yarn electron-builder --` steps. Only a v* tag publishes; a macOS tag build forces code signing. CSC_* come from mac_certs on macOS only (empty elsewhere, which electron-builder treats as unset). The workflow token is read-only except on the release job. mac.notarize is off so the afterSign hook stays the one notarize path. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yaml | 44 +++++++++++++++++++++++++----------- package.json | 2 ++ 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7aea2448..bd69ea2d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,6 +2,9 @@ name: Build/release on: push +permissions: + contents: read + jobs: lint: runs-on: ubuntu-24.04 @@ -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 @@ -45,19 +58,24 @@ 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 + run: >- + 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 }} diff --git a/package.json b/package.json index 0150b7f6..6ea3dd6f 100644 --- a/package.json +++ b/package.json @@ -146,6 +146,8 @@ }, "mac": { "identity": "Johannes Klein (9VR92ZCXA8)", + "type": "distribution", + "notarize": false, "mergeASARs": false, "target": [ { From e49904c47b82e5bc4b0e2f1ca258c31e0f00acc2 Mon Sep 17 00:00:00 2001 From: Johannes Klein Agents Date: Thu, 26 Nov 2026 11:44:02 +0100 Subject: [PATCH 2/2] Leave CSC_LINK unset when the macOS certificate secret is empty (#372) electron-builder treats an empty CSC_LINK on macOS as a certificate path and fails with "not a file". The old action only set it when non-empty. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bd69ea2d..8049eaf4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -68,10 +68,13 @@ jobs: # Only a v* tag publishes; a macOS tag build fails without a signing certificate. - name: Package and publish - run: >- - 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' || '' }} + 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 || '' }}