From ba7a672419a2804d08a7f29dca3f5c98380f1004 Mon Sep 17 00:00:00 2001 From: OA Hsiao Date: Wed, 24 Jun 2026 18:24:27 +0800 Subject: [PATCH 1/2] fix(ci): release build attempts publish (duplicate --publish never) The dist script now runs electron-builder once per arch and already passes --publish never to each. The release workflow also appended '-- --publish never', which npm adds to the last invocation, giving it --publish twice. Duplicated flags parse as an array that electron-builder no longer treats as 'never', so it auto-published on the tag and failed with no GH_TOKEN. Use plain 'npm run dist'. --- .github/workflows/release.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a1b3bbb..1d635e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,11 +43,17 @@ jobs: run: npm run rebuild - name: Build installer (electron-builder) - # --publish never: only package the artifacts here. Publishing is - # handled by the dedicated "Publish GitHub Release" step below. - # Without this, electron-builder auto-publishes on a tag and fails - # with "GitHub Personal Access Token is not set". - run: npm run dist -- --publish never + # The dist script already passes `--publish never` to each per-arch + # electron-builder invocation, so this step only packages the + # artifacts. Publishing is handled by the dedicated "Publish GitHub + # Release" step below. + # + # Do NOT append another `-- --publish never` here: npm would add it to + # the last invocation in the chain, giving it `--publish` twice. A + # duplicated flag is parsed as an array (["never","never"]) which + # electron-builder no longer treats as "never", so it auto-publishes on + # the tag and fails with "GitHub Personal Access Token is not set". + run: npm run dist - name: Publish GitHub Release uses: softprops/action-gh-release@v2 From f010f41c6622bf0598c4df86f2a484eaeec59b7d Mon Sep 17 00:00:00 2001 From: OA Hsiao Date: Wed, 24 Jun 2026 18:32:20 +0800 Subject: [PATCH 2/2] fix(release): single multi-arch electron-builder invocation (match M2_LOG) Two chained electron-builder calls + the workflow's '-- --publish never' gave the last call --publish twice. A duplicated flag parses as an array, so electron-builder ignored 'never' and tried to auto-publish on the tag, failing with no GH_TOKEN. Use one 'electron-builder --win --x64 --arm64' call (like M2Station/M2_LOG), with --publish never applied once by the workflow. Produces combined + per-arch installers (x64, arm64). --- .github/workflows/release.yml | 18 +++++++----------- package.json | 12 ++++++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d635e9..7645885 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,17 +43,13 @@ jobs: run: npm run rebuild - name: Build installer (electron-builder) - # The dist script already passes `--publish never` to each per-arch - # electron-builder invocation, so this step only packages the - # artifacts. Publishing is handled by the dedicated "Publish GitHub - # Release" step below. - # - # Do NOT append another `-- --publish never` here: npm would add it to - # the last invocation in the chain, giving it `--publish` twice. A - # duplicated flag is parsed as an array (["never","never"]) which - # electron-builder no longer treats as "never", so it auto-publishes on - # the tag and fails with "GitHub Personal Access Token is not set". - run: npm run dist + # --publish never: build the multi-arch NSIS installers (x64 + arm64) + # locally only; the "Publish GitHub Release" step below uploads them. + # Without this, electron-builder auto-detects the tag and tries to + # publish itself, failing because GH_TOKEN isn't set in this step. + # NOTE: dist is a single electron-builder invocation, so --publish never + # is applied exactly once (no duplicate-flag array problem). + run: npm run dist -- --publish never - name: Publish GitHub Release uses: softprops/action-gh-release@v2 diff --git a/package.json b/package.json index ca829eb..bc489c0 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "start": "cross-env NODE_ENV=development electron .", "start:prod": "cross-env NODE_ENV=production electron .", "rebuild": "electron-rebuild -f -w better-sqlite3", - "dist": "vite build && electron-builder --win --x64 --publish never && electron-builder --win --arm64 --publish never", + "dist": "vite build && electron-builder --win --x64 --arm64", "release": "powershell -ExecutionPolicy Bypass -File scripts/release.ps1", "demo:gif": "node scripts/make-demo-gif.mjs", "check:license": "node scripts/check-license-headers.mjs", @@ -62,16 +62,20 @@ "win": { "target": [ { - "target": "nsis" + "target": "nsis", + "arch": [ + "x64", + "arm64" + ] } ], - "icon": "public/icon.ico" + "icon": "public/icon.ico", + "artifactName": "${productName} Setup ${version} ${arch}.${ext}" }, "nsis": { "oneClick": false, "perMachine": false, "allowToChangeInstallationDirectory": false, - "artifactName": "${productName} Setup ${version} ${arch}.${ext}", "include": "installer/installer.nsh", "installerIcon": "public/icon.ico", "uninstallerIcon": "public/icon.ico",