Unverified Commit 2884eb21 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[cd] Fix release branch gate and drop dead lerna publish config (#99039)

Mostly just updating obsolete/stale information.
parent 593cec11
# Release Channels and Publishing # Release Channels and Publishing
Next.js has two release channels: `stable` and `canary`. Next.js publishes to several release channels. `stable` and `canary` are the two
that most users interact with; `beta`, `release-candidate`, and `preview` are
used in the run-up to a major release and for testing unreleased builds.
## Stable ## Stable
...@@ -8,9 +10,6 @@ The stable release is what is installed when you `npm install next`. This channe ...@@ -8,9 +10,6 @@ The stable release is what is installed when you `npm install next`. This channe
This channel is published at a regular cadence and follows [semantic versioning](https://semver.org). This channel is published at a regular cadence and follows [semantic versioning](https://semver.org).
Repository maintainers can publish a new stable version using: `pnpm publish-stable`.
The command will ask what version to publish `major`, `minor`, or `patch`.
## Canary ## Canary
The canary channel has to be explicitly installed by users through `npm install next@canary`. The canary channel has to be explicitly installed by users through `npm install next@canary`.
...@@ -21,5 +20,22 @@ This channel is published early based on the `canary` branch. It holds all chang ...@@ -21,5 +20,22 @@ This channel is published early based on the `canary` branch. It holds all chang
By installing `next@canary` from time to time you can check if your application is affected by any changes that have not been published yet. By installing `next@canary` from time to time you can check if your application is affected by any changes that have not been published yet.
Repository maintainers can publish a new canary version using: `pnpm publish-canary`. ## Publishing
The command will automatically decide the new version tag as it's an increment from the previous version.
Publishing is driven by CI, not by a local command. Repository maintainers
trigger the
[`Trigger Release`](https://github.com/vercel/next.js/actions/workflows/trigger_release.yml)
workflow, which takes a `releaseType` (`canary`, `stable`, `release-candidate`,
`beta`, or `preview`) and, for stable releases, a `semverType` (`patch`,
`minor`, or `major`). Canary releases also run automatically on a nightly
schedule.
The workflow bumps the version across all packages and pushes the release
commit and tag. That tag then triggers
[`build_and_deploy.yml`](https://github.com/vercel/next.js/actions/workflows/build_and_deploy.yml),
which builds the packages and publishes them to npm under the dist-tag matching
the channel.
Version bumps are restricted to the release branches listed in
`command.version.allowBranch` in `lerna.json`. `scripts/create-release-branch.js`
adds a new release branch to that list when one is created.
...@@ -5,14 +5,10 @@ ...@@ -5,14 +5,10 @@
], ],
"command": { "command": {
"version": { "version": {
"exact": true "exact": true,
},
"publish": {
"npmClient": "npm",
"allowBranch": [ "allowBranch": [
"canary" "canary"
], ]
"registry": "https://registry.npmjs.org/"
} }
}, },
"version": "16.4.0-canary.39" "version": "16.4.0-canary.39"
......
...@@ -88,7 +88,9 @@ async function main() { ...@@ -88,7 +88,9 @@ async function main() {
const existingLerna = JSON.parse( const existingLerna = JSON.parse(
await fs.promises.readFile(lernaPath, 'utf8') await fs.promises.readFile(lernaPath, 'utf8')
) )
existingLerna.command.publish.allowBranch.push(branchName) // `allowBranch` gates `lerna version`, so it lives under `command.version`.
// Release branches need to be added here or the version bump refuses to run.
existingLerna.command.version.allowBranch.push(branchName)
await fs.promises.writeFile(lernaPath, JSON.stringify(existingLerna, null, 2)) await fs.promises.writeFile(lernaPath, JSON.stringify(existingLerna, null, 2))
......
...@@ -199,7 +199,8 @@ async function main() { ...@@ -199,7 +199,8 @@ async function main() {
if (dryRun) { if (dryRun) {
// So the dry-run can be exercised outside // So the dry-run can be exercised outside
// of the release branches lerna.json restricts in real publishes. // of the release branches `command.version.allowBranch` in lerna.json
// restricts real version bumps to.
lernaArgs.push('--allow-branch', '**') lernaArgs.push('--allow-branch', '**')
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment