Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

ci: use electron/semantic-trusted-release instead of npx#181

Closed
MarshallOfSound wants to merge 1 commit intomainfrom
sam/use-semantic-trusted-release
Closed

ci: use electron/semantic-trusted-release instead of npx#181
MarshallOfSound wants to merge 1 commit intomainfrom
sam/use-semantic-trusted-release

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

Replaces the two-phase npx semantic-release pattern with electron/semantic-trusted-release (same as the rest of the org).

The old flow:

  1. npm install -g semantic-release@22.0.6 semantic-release-export-data@v1.0.1
  2. npx semantic-release@22.0.6 --dry-run → exports next version
  3. Stamp version into binaries
  4. npx semantic-release@22.0.6 → publish

The npm -g install meant npx resolved the global install rather than fetching fresh, but there was no lockfile — semantic-release@22.0.6 resolves to whatever transitive tree npm gives you on the day, and semantic-release-export-data@v1.0.1 came along unpinned.

The new flow:
Single semantic-release run. @semantic-release/exec's prepareCmd hook fires after the version is determined but before publish — exactly when stamping needs to happen. The cross-stamp-and-verify logic (x64 stamps x86, verify, x86 stamps x64, verify) is unchanged, just moved to scripts/stamp-version.sh.

@semantic-release/exec isn't bundled with semantic-release core and isn't in semantic-trusted-release's lockfile, so it's installed locally via npm ci + package-lock.json — semantic-release resolves plugins from the project's own node_modules.

Also:

  • persist-credentials: false on checkout
  • pull-requests/issues write perms for release comments
  • node_modules/ in .gitignore

Replaces the two-phase npx semantic-release pattern (dry-run → stamp
→ real run) with a single run using @semantic-release/exec's
prepareCmd hook. The prepare step fires after the version is
determined but before publish — exactly when version stamping
needs to happen.

The previous approach used npm install -g semantic-release@22.0.6
followed by npx semantic-release@22.0.6. The npm -g install meant
npx resolved the global install rather than fetching from the
registry, but the whole thing was still unpinned at the lockfile
level and semantic-release-export-data was fetched unpinned.

@semantic-release/exec isn't bundled with semantic-release core and
isn't in semantic-trusted-release's lockfile, so it's installed
locally via package-lock.json. semantic-release resolves plugins
from the project's own node_modules.

The stamp logic moved to scripts/stamp-version.sh — same
cross-stamp-and-verify pattern (x64 stamps x86, verify, x86 stamps
x64, verify).
@MarshallOfSound MarshallOfSound requested a review from a team as a code owner March 31, 2026 05:37
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​semantic-release/​exec@​7.1.010010010085100

View full report

Comment thread package-lock.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: since there's no lockfile to migrate, would it make sense to take the opportunity and have this package use yarn instead of npm?

Comment thread .releaserc.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: @semantic-release/commit-analyzer, @semantic-release/release-notes-generator and @semantic-release/github are transitively pulled via whatever version of semantic-release is depended on by @semantic-release/exec, is that setup expected/acceptable or should we explicitly depend on those plugins instead?

@dsanders11 dsanders11 closed this Mar 31, 2026
@dsanders11 dsanders11 deleted the sam/use-semantic-trusted-release branch March 31, 2026 17:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants