Skip to content

Commit b1a90ba

Browse files
JohnMcLearclaude
andauthored
fix(release): scope snap to snap-publish.yml + don't double-publish (#11)
Two issues surfaced on the v0.2.0 tag's first run: 1. snap-publish.yml's "Build snap" step failed because electron-builder detected the git tag and attempted an implicit publish to the Snap Store from inside the build job. SNAPCRAFT_STORE_CREDENTIALS is scoped to the dedicated publish-edge / publish-stable jobs only, so the build's keyring lookup failed and the workflow died before the snap was even uploaded as an artifact. Pass --publish never to the build step; the dedicated publish jobs use snapcore/action-publish with the credentials properly scoped. 2. release-linux's package step tried to build all three Linux targets from the electron-builder.yml (AppImage, deb, snap), which is redundant with snap-publish.yml AND triggers the same implicit- publish behaviour. Pass an explicit "AppImage deb" target list so this job only owns AppImage + deb. Snap is exclusively owned by snap-publish.yml. (The release-linux run for v0.2.0 also showed an AppImage cache rename race during the snap step — moot once snap is removed from this job. The actual AppImage and deb artefacts uploaded successfully and are on the v0.2.0 GitHub Release page; this commit just stops the spurious failure.) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f7c1a7f commit b1a90ba

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ jobs:
2121
- name: Build
2222
run: pnpm build
2323
- name: Package
24-
run: pnpm exec electron-builder --linux --config build/electron-builder.yml --publish always
24+
# Only AppImage + deb here. Snap is owned by snap-publish.yml
25+
# (separate job, separate credentials). Without an explicit list,
26+
# electron-builder reads the linux.target array in the YAML —
27+
# which includes snap — and tries to publish a snap to the Snap
28+
# Store from this job, which doesn't have the credentials.
29+
run: pnpm exec electron-builder --linux AppImage deb --config build/electron-builder.yml --publish always
2530
env:
2631
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732
- uses: actions/upload-artifact@v4

.github/workflows/snap-publish.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ jobs:
6161
# electron-builder's snap target invokes snapcraft under the hood; in
6262
# CI we want destructive-mode (no LXD container).
6363
SNAPCRAFT_BUILD_ENVIRONMENT: 'host'
64-
run: pnpm exec electron-builder --linux snap --config build/electron-builder.yml
64+
# --publish never: electron-builder otherwise tries to push to the
65+
# Snap Store during build when it sees a git tag, but
66+
# SNAPCRAFT_STORE_CREDENTIALS is only available in the publish-*
67+
# jobs below. Disable implicit publish; the dedicated job uses
68+
# snapcore/action-publish with the credentials properly scoped.
69+
run: pnpm exec electron-builder --linux snap --config build/electron-builder.yml --publish never
6570

6671
- name: Locate snap file
6772
id: find

0 commit comments

Comments
 (0)