Commit Graph

28 Commits

Author SHA1 Message Date
Sebastian "Sebbie" Silbermann 7443e117dc [cd] Replace the release package with our own GitHub release creation (#95352) 2026-07-02 09:07:26 +00:00
Sebastian "Sebbie" Silbermann 681940523a [cd] add ad-hoc preview release cut from canary (#95086)
Add a `preview` release type so `@preview` npm releases can be cut
**ad-hoc from `canary`** via the `Trigger Release` workflow, retiring
the dedicated long-lived preview branch. The GitHub environment has been
updated accordingly.

A preview cut produces **two commits**, pushed in a single update:

1. **Bump-to-preview** — all packages set to the computed preview
version, tagged `v…-preview.N`. This tag's build publishes `@preview`
(relies on #95085).
2. **Revert-to-canary** — restores the `-canary.N` versions so `canary`
keeps advancing its own line and isn't stranded on a preview version.

```
B  canary HEAD before cut (e.g. 16.3.0-canary.61)
│
P  v16.3.0-preview.N   ← tag here; tag build publishes @preview
│
R  canary HEAD after cut (versions restored to 16.3.0-canary.61)
```

### Preview version numbering

`base = max(canary major.minor.patch, npm @preview major.minor.patch)`:
- base still on the published preview line → continue it (`n + 1`)
- canary advanced to a higher base (or no `@preview` published) → reset
to `.0`

So if `canary` jumps to `18.0.0-canary.x` since the last
`16.3.0-preview.x`, the next cut is `18.0.0-preview.0`, not a
continuation.

## Test plan

The dry mode of `start-release.js` was extended to intercept the GH
requests and log the relevant data.

```console
$ node ./scripts/start-release.js --release-type preview --dry-run
Dry run: keeping commits locally, skipping git push and GitHub release creation
Running pnpm release-preview...
[...]
> lerna version 16.3.0-preview.4 --force-publish -y --no-push --allow-branch '**'
[...]
Creating GitHub-signed release commit(s) for v16.3.0-preview.4 from local commits 0f5c1e865cc34edb257a16823ed6525d9cd58bfc..0062348c411776271fe7eac64e97b8bad2775b77
[dry-run] GitHub API POST /repos/vercel/next.js/git/blobs [...]
[dry-run] GitHub API POST /repos/vercel/next.js/git/commits {"message":"v16.3.0-preview.4","tree":"0000000000000000000000000000000000000016","parents":["0f5c1e865cc34edb257a16823ed6525d9cd58bfc"]}
[dry-run] GitHub API POST /repos/vercel/next.js/git/commits {"message":"Restore canary version 16.3.0-canary.61 after v16.3.0-preview.4 preview release","tree":"000000000000000000000000000000000000002d","parents":["0000000000000000000000000000000000000017"]}
[dry-run] GitHub API POST /repos/vercel/next.js/git/refs {"ref":"refs/tags/v16.3.0-preview.4","sha":"0000000000000000000000000000000000000017"}
[dry-run] GitHub API PATCH /repos/vercel/next.js/git/refs/heads/sebbie/preview-release-from-canary {"sha":"000000000000000000000000000000000000002e","force":false}
Dry run: skipping local branch sync; would set sebbie/preview-release-from-canary to 000000000000000000000000000000000000002e and tag v16.3.0-preview.4 at 0000000000000000000000000000000000000017
Created GitHub-signed release tag v16.3.0-preview.4 at 0000000000000000000000000000000000000017; branch sebbie/preview-release-from-canary now at 000000000000000000000000000000000000002e
Dry run: skipping GitHub release creation
Release process is finished
```
2026-06-24 16:33:37 +02:00
Sebastian "Sebbie" Silbermann 618957c166 [cd] More robust publish pipeline (#94622) 2026-06-17 19:44:59 +02:00
Zack Tanner 012fd7df4b [ci]: trigger signed release commit via API (#93285)
Stacked on https://github.com/vercel/next.js/pull/93245

Commit signing is required for anything that lands on `canary`. Our
previous workflow of using a PAT to push a commit no longer works, since
that would have been an unsigned commit.

In #93245 we switched to an app token for release workflow steps. This
continues by:

- Telling Lerna to bump packages but not commit
- Creating a signed commit with the staged changes via GitHub's API
- Then running the publish flow

Test Plan:
Dry run
[here](https://github.com/vercel/next.js/actions/runs/25001287978/job/73211826479)
Commit
[here](https://github.com/vercel/next.js/commit/3a8456a62b56615e2f8c1d1e6e7b4e14ce89e078)
2026-04-27 16:31:05 +00:00
Zack Tanner e69de2ffaf [ci]: app-based release workflow (#93245)
Moves all release workflows off of a GH PAT and uses an app with a
short-lived token instead.

Test Plan:
Dry run
[here](https://github.com/vercel/next.js/actions/runs/24934593874).

However, this workflow is blocked until we figure out commit signing for
the bot app. Some options:
- The bot account generates a signing key and we use it in CI (not
great, bypasses the app)
- The org bypasses signature verification for the bot user (also not
great, requires an exemption rule)
- We need to rework the commit step so Lerna does not do the push, and
instead trigger it via the app + GH API. This seems like the best
option, will be added in a follow-up PR.

Note: `create-release-branch` workflow is broken in its current form, as
we will not be restoring administrator privileges to adjust environment
settings. This will become a manual step in the future.
2026-04-27 07:55:43 -07:00
Jimmy Lai 5c8fdbe104 misc: allow beta to be triggered (#84713)
![a-picture-of-a-bear-in-a-spaceship-with-the-words-i-have-no-idea-what-i-m-doing](https://github.com/user-attachments/assets/a53076b7-6d4c-4e98-b540-b4f6950d4901)

- update codemod script
- upgrade both release scripts, not sure which one is correct


<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2025-10-09 16:28:52 -07:00
JJ Kasper fb319ce1bf Update nextjs-bot config (#81138)
Follow-up from https://github.com/vercel/next.js/pull/81134 updating the
email used in commit messages as well.
2025-07-01 10:43:14 -07:00
JJ Kasper 890c11996a Update workflows for nextjs-bot (#81134)
This updates to use the new bot account specific for Next.js which we've
already been using for stale issues for a bit.
2025-07-01 10:23:05 -07:00
JJ Kasper 913bf03af0 Handle premajor version for canary (#66336)
Ensures we can cut premajors for canary the same as release-candidate
tags.
2024-05-29 08:26:51 -07:00
JJ Kasper f6db3b79b1 add missing -y to start-release 2024-05-23 08:09:29 -07:00
JJ Kasper 188b37d11d Add release candidate handling to start release (#66107)
This adds support for a new `rc` publish tag to our start release
workflow.
2024-05-22 23:52:56 -05:00
JJ Kasper 9f38cfee3d Update to only use preminor when configured (#62904)
Ensures we don't use preminor every time only when we manually specify
to

x-ref:
https://github.com/vercel/next.js/actions/runs/8161338410/job/22309868382

Closes NEXT-2716
2024-03-05 12:34:51 -08:00
JJ Kasper 9547635bf7 Update canary semver handling (#62852)
As discussed this updates our canary semver bumping to use `preminor`
instead of `prerelease` to avoid overlap with patches/backports and make
it more clear for users which versions go along together.

x-ref: [slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1709583075769789)

Closes NEXT-2701
2024-03-04 16:48:55 -08:00
JJ Kasper e5a4e82f30 Update start release handling (#62851)
This removes the hacky handling for executing lerna with using the
official commands directly, this also removes the legacy package.json
scripts we had for publishing.

Closes NEXT-2700

---------

Co-authored-by: Zack Tanner <zacktanner@gmail.com>
2024-03-04 16:28:22 -08:00
Zack Tanner 811e5c4fd5 move release undraft step until after canary is fully published (#57324)
Currently we publish a release in GitHub before it's actually fully published to npm. This moves the undraft step until after the publish is finished
2023-10-31 18:37:06 +00:00
Jimmy Lai 0bcba460b7 fix publish script 2023-10-26 08:58:37 -07:00
Jiachi Liu ad79fed1a2 ci: update github token (#50216)
[slack-thread](https://vercel.slack.com/archives/C01LN7C5QR5/p1684849596794369?thread_ts=1684428058.764599&cid=C01LN7C5QR5)
2023-05-23 07:29:58 -07:00
Jiachi Liu 9314fb6597 Wait for versioning prompt to show up for stable release (#48692)
Wait for the prompt to show up then enter the cursor change or "y" for
prompt to avoid write to child process too early

Example
```
Running pnpm release-stable...
Releasing patch: cursor stay
Enter newline
Enter y
Await child process...
> nextjs-project@0.0.0 release-stable /home/runner/work/next.js/next.js
> lerna version --force-publish
lerna notice cli v4.0.0
lerna info ci enabled
lerna info current version 13.3.1-canary.19
lerna WARN force-publish all packages
lerna info Assuming all packages changed
? Select a new version (currently 13.3.1-canary.19) (Use arrow keys)
❯ Patch (13.3.1) 
  Minor (13.4.0) 
  Major (14.0.0) 
  Prepatch (13.3.2-canary.0) 
  Preminor (13.4.0-canary.0) 
  Premajor (14.0.0-canary.0) 
  Custom Prerelease 
  Custom Version ? Select a new version (currently 13.3.1-canary.19) Patch (13.3.1)
Changes:
```
2023-04-21 17:58:24 -04:00
Jiachi Liu 4f1b0f737a Add logs to release job (#48690)
Adding more logs for GA release job

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-04-21 22:54:12 +02:00
JJ Kasper 3a83c6b313 Update start release flow (#48634)
x-ref: [slack
thread](https://vercel.slack.com/archives/C01LN7C5QR5/p1681914697254659)
2023-04-20 15:58:36 +00:00
JJ Kasper 2a68ecf509 Fix stable release start (#48044)
x-ref:
https://github.com/vercel/next.js/actions/runs/4632849191/jobs/8197395820
2023-04-06 14:52:56 -07:00
JJ Kasper 400ccf7b1c Update to retry undrafting canary (#47826)
x-ref:
https://github.com/vercel/next.js/actions/runs/4588934126/jobs/8103482375#step:10:658
2023-04-02 11:37:08 -07:00
JJ Kasper 083dd2a59f Tweak canary undrafting (#47777)
Fixes:
https://github.com/vercel/next.js/actions/runs/4581084068/jobs/8090349455#step:10:661
2023-03-31 21:06:51 -07:00
JJ Kasper 6e5eb2c4d2 Update publish canary to undraft automatically (#47775)
x-ref: [slack
thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1680313038895799?thread_ts=1680303743.811339&cid=C04DUD7EB1B)
2023-03-31 19:00:12 -07:00
JJ Kasper bd8ba61bca Update release package.json scripts (#47529)
We should no longer be starting releases from local and instead use the
GH action so this updates the scripts to point to there.
2023-03-25 12:59:51 -07:00
JJ Kasper cbb6dda6a3 Tweak trigger release cloning 2023-03-23 23:07:52 -07:00
JJ Kasper af89adbd61 Update fetch cache memory handling (#47465)
This ensures we only honor cache entries from the in memory cache for up
to 2 seconds so that revalidates can correctly propagate and also
increases max fetch cache entry size to 2 MB. The `fetchCache` export is
also being detected in this PR but not yet honored which will be done in
a follow-up.
2023-03-23 22:30:08 -07:00
JJ Kasper d0bdd8f230 Add workflow to trigger release (#47461)
As discussed this adds a publish workflow that can be triggered for
canary or stable releases which ensures we are publishing from a
consistent environment and local config doesn't affect a release.
2023-03-23 16:28:49 -07:00