Commit Graph

21 Commits

Author SHA1 Message Date
Sebastian "Sebbie" Silbermann 59b76e42ba [cd] Update peerDependencies in prereleases to accept the current prerelease (#98411)
https://github.com/vercel/next.js/pull/98330 revealed theat
`@next/third-parties` never worked with prereleases after 16.0. Now we
[update `peerDependencies` similar to what we do for preview builds
already](https://github.com/vercel/next.js/blob/27f679224e2660971377f855ced51093462734d8/scripts/create-preview-tarballs.js#L130-L132)
(we should unify both eventually to go through the same flow).

Fixes
```
  npm error code ERESOLVE
  npm error ERESOLVE unable to resolve dependency tree
  npm error
  npm error While resolving: undefined@undefined
  npm error Found: next@16.4.0-canary.22
  npm error node_modules/next
  npm error   next@"16.4.0-canary.22" from the root project
  npm error
  npm error Could not resolve dependency:
  npm error peer next@"^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0-beta.0" from @next/third-parties@16.4.0-canary.22
  npm error node_modules/@next/third-parties
  npm error   @next/third-parties@"16.4.0-canary.22" from the root project
```
-- https://github.com/vercel/next.js/actions/runs/34291905918/attempts/2
2026-09-09 13:39:15 +00:00
Steven b229f6400c [cd] reduce size of npm metadata on publish (#94953) 2026-06-19 01:02:53 +02:00
Sebastian "Sebbie" Silbermann 47c8c6fc92 [cd] Continue release train if @next/swc-wasm-* fails to publish (#94912)
https://github.com/vercel/next.js/pull/94622 tried to be more strict
with when a release is considered healthy. However, `@next/swc-wasm-web`
is not enrolled in Trusted Publishing and blocks the release train.

This PR restores the behavior for `@next/swc-wasm-*` packages prior to
https://github.com/vercel/next.js/pull/94622 i.e. we continue the
release train even if any `@next/swc-wasm-*` fails. Other NAPI bindings
will continue to block the release train if they fail to publish.

The bail vs no-bail behavior is controlled with a repository variable so
that we can mor easily test if `@next/swc-wasm-web` is enrolled in
Trusted Publishing.
2026-06-17 20:49:57 +02:00
Sebastian "Sebbie" Silbermann 618957c166 [cd] More robust publish pipeline (#94622) 2026-06-17 19:44:59 +02: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
Zack Tanner 129896c2e4 [ci]: remove publish token in favor of OIDC (#93065)
Switches from a long-lived token to trusted publishing OIDC flow. This requires a bump to Node (for feature support). Otherwise just dropping unnecessary envs.
2026-04-20 11:17:33 -07:00
JJ Kasper cd293963ab Update beta tag (#84725)
Ensures we use correct tag for beta publish same as rc publish.
2025-10-09 20:17:48 -07:00
Jiwon Choi 3ddc20a4fb [release-old] use backport NPM dist tag instead of stable for backports (#79612)
PR https://github.com/vercel/next.js/pull/79596 introduced setting
`stable` dist tag for backports, but due to
https://github.com/vercel/next.js/pull/79538#pullrequestreview-2866854431,

> This sounds like something users would use. However, it might point to
14.x when 15.x exists and we would certainly want people to use 14.x.
It's also weird that 14.x would have a `stable` tag but not 15.x.
> 
> That's why `backport` makes more sense since it's less specific and
not common vernacular when talking about release characteristics (e.g.
"experimental", "nightly", "stable", "unstable" etc.).
> 
> The tag could actually just be "internal-backport" and ideally we'd
remove it right after publish. The goal here isn't to come up with a
useful tag for backports. We just want to work around NPM requiring a
tag during publish.

better to use another dist tag: i.e.,`backport`.
2025-05-25 16:39:55 +02:00
JJ Kasper 0e769b3283 Fix --tag argument in publish-release (#79599)
Somehow `@ts-check` didn't catch this array not being spread anymore.
2025-05-24 17:38:40 -07:00
Jiwon Choi 2bb5ed2103 [release-legacy] fix: set stable dist tag for backport releases instead of latest (#79596)
### Why?

If the current version is less than the latest, it means this is a
backport release. Since NPM sets the `latest` tag by default during
publishing, when users install `next@latest`, they might get the
backported version instead of the actual "latest" version. Therefore, we
explicitly set the tag as `stable` for backports.
2025-05-24 22:12:32 +02: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 04b13f52a5 Update error handling in publish scripts (#62754)
Seems we aren't ignoring the already published error correctly.

x-ref:
https://github.com/vercel/next.js/actions/runs/8118349923/job/22192598805

Closes NEXT-2668
2024-03-02 00:40:51 +00:00
JJ Kasper 2a824e97db Ensure publish job has correct status on fail (#61645)
This ensures we show the job as failed correctly when any of the
packages didn't publish successfully.

x-ref:
https://github.com/vercel/next.js/actions/runs/7777481701/job/21205867173

Closes NEXT-2355
2024-02-05 00:06:16 +00: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
Sukka 17553c5e25 chore: reduce fs-extra usage in scripts/ (#56917)
The PR follows #56536 and #56491, replacing `fs-extra` usages inside the `scripts/` folder.

Note that the `copy` and `move` haven't been replaced yet. Currently, there is no better recursive copy (lightweight, promise-based, Node.js built-in `copyFile` API-based, support the `filter` option) library alternative available on npm, and Node.js built-in `fs.rename` doesn't support `overwrite`.

The PR also replaces many async fs API usage with their sync versions.

cc @wbinnssmith
2023-10-17 19:31:19 +00:00
Tobias Koppers 44eba020c6 improve publish-release (#55597)
Closes WEB-1608
2023-09-19 18:23:51 +02:00
JJ Kasper efaddcda60 Fix race condition with publish (#51105)
We publish multiple packages in parallel which can cause issues with the
prepublish only script running as turbo clearing/restoring dist caches
can causing files to be missing if a publish is in progress. We also
don't need to run these as all packages are already built prior to
publishing. This also includes fixes for release stats.
2023-06-10 14:05:27 -07:00
JJ Kasper 6b863fe294 Apply publish step optimizations (#43620)
Follow-up to https://github.com/vercel/next.js/pull/32337 this removes
the un-necessary step where we fetch all of the tags which requires
pulling a lot of un-necessary git history inflating cache size and
publish times.

The only reason these tags were needing to be fetched is due to an issue
in how the `actions/checkout` step works
(https://github.com/actions/checkout/issues/882).

This reduces the publish times by at least 4 minutes by removing the
tags fetching step
https://github.com/vercel/next.js/actions/runs/3598569786/jobs/6061449995#step:16:14

As a further optimization this adds concurrency to the `npm publish`
calls themselves to hopefully reduce time spent there as well.
2022-12-01 21:48:51 -08:00
JJ Kasper 47e5ebe0b2 update publish 2022-10-25 09:14:29 -07:00
JJ Kasper f19241bf33 Update publish to skip private package (#40822)
Follow-up to https://github.com/vercel/next.js/pull/40815 ensures we
skip attempting to publish private packages like `next-swc`

x-ref:
https://github.com/vercel/next.js/actions/runs/3109438515/jobs/5039954716
2022-09-22 17:49:44 -07:00
JJ Kasper 2cbbd61b4a Update publish script to skip lerna (#40815)
This updates our `publish-release` script to bypass lerna so that we can
retry publishing automatically when there is an npm error and tolerate
non-fatal publish errors like already existing published versions.
Currently this will only allow publishing a canary release to ensure it
is working as expected and in a follow-up we can enable the stable
publish handling.

Separately we can investigate moving canaries away from `npm` to reduce
the number of versions being created there.

x-ref: https://github.com/vercel/next.js/pull/40812
x-ref:
https://github.com/vercel/next.js/actions/runs/3108735543/jobs/5038717354#step:10:2332
x-ref:
https://github.com/vercel/next.js/actions/runs/3108335849/jobs/5038069555
2022-09-22 16:22:17 -07:00