| title | Releasing | ||
|---|---|---|---|
| summary | Release and trusted npm publishing for @module-federation/electron. | ||
| read_when |
|
||
| updated_at | 2026-11-04 |
Releases are cut by release-please
from Conventional Commits on main. PRs are squash-merged with the PR title as
the commit message, and Validate PR title enforces the format, so the PR title
decides the release:
fix:(andperf:) releases a patch.feat:releases a minor.feat!:or aBREAKING CHANGE:footer releases a minor while the package is below 1.0 (bump-minor-pre-major), then a major.chore:,docs:,test:,ci:,refactor:, andbuild:release nothing and stay out of the changelog.
Run the complete local gate before merging:
pnpm install --frozen-lockfile
pnpm format:check
pnpm lint
pnpm typecheck
pnpm build
pnpm test
pnpm check:publishable
pnpm pack:electronOn every push to main, the Release Please workflow opens or updates a
chore: release <version> PR that bumps packages/electron/package.json,
.release-please-manifest.json, and packages/electron/CHANGELOG.md. Edit the
PR's changelog entry before merging if the commit titles need context.
To force a version, the commit on main needs a Release-As: x.y.z footer.
Squash merges here keep only the PR title and drop the body, and rebase merges
drop empty commits, so set the footer when you merge:
gh pr merge <number> --squash --body "Release-As: x.y.z". The commit must
also change a file under packages/electron/, because release-please ignores
commits outside the package path.
Merging the release PR makes release-please tag the merge commit and publish a
GitHub Release named after the version, without a v (0.1.1, not v0.1.1).
That release triggers Release, which publishes to npm under latest.
release-please authenticates with RELEASE_APP_ID and RELEASE_APP_PRIVATE_KEY, a GitHub App with contents, issues and pull-request write access: releases created with the default GITHUB_TOKEN
would not trigger the publish workflow.
Preview dispatches of Release with version=next publish the next patch
version with a -next.<run id> suffix to npm's next dist-tag. Dispatching with
version=latest republishes the committed version and is only needed when a
release-triggered publish failed.
GitHub prerelease tags must match the prerelease version already committed in
packages/electron/package.json. The workflow publishes that exact version to
the next dist-tag.
The publish workflow reruns the gate, checks that the source is reachable from
main, uses npm provenance, and refuses to republish an existing version under
a different dist-tag. It publishes through npm trusted publishing for
repository module-federation/electron, workflow release.yml, environment
Publish, so the repository needs a Publish environment.
npm only lets a package that already exists name a trusted publisher, so the
workflow cannot publish @module-federation/electron the first time. Bootstrap
it once, as a maintainer with publish rights in the @module-federation npm
organization:
- Publish a placeholder from an empty directory: a
package.jsonwith"name": "@module-federation/electron"and"version": "0.0.0", thennpm publish --access public. - Add the trusted publisher on npmjs.com (package settings, "Trusted
Publisher", GitHub Actions) or with npm 11.10+:
npm trust github @module-federation/electron --file release.yml --repo module-federation/electron --env Publish --allow-publish. - Release
0.0.1through the workflow within two days: npm discards a trusted publisher configuration that has not published by then. - Deprecate the placeholder:
npm deprecate @module-federation/electron@0.0.0 "Placeholder; use 0.0.1 or later."
npm also has a 0.1.0 from the bootstrap: the initial scaffold, published before
the version was reset to 0.0.1. npm never allows a version to be published
twice, so releases skipped from 0.0.1 to 0.1.1.
Trusted publishing needs npm 11.5.1+ on Node 22.14+; the workflow's Node 24
includes it. Releases after 0.0.1 need no manual step.