Unverified Commit 5c8fdbe1 authored by Jimmy Lai's avatar Jimmy Lai Committed by GitHub

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: 's avatargraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 8d475c54
...@@ -6,13 +6,14 @@ on: ...@@ -6,13 +6,14 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
releaseType: releaseType:
description: stable, canary, or release candidate? description: stable, canary, beta, or release candidate?
required: true required: true
type: choice type: choice
options: options:
- canary - canary
- stable - stable
- release-candidate - release-candidate
- beta
semverType: semverType:
description: semver type? description: semver type?
......
...@@ -19,6 +19,7 @@ on: ...@@ -19,6 +19,7 @@ on:
- canary - canary
- stable - stable
- release-candidate - release-candidate
- beta
force: force:
description: Forced Release description: Forced Release
......
...@@ -60,12 +60,14 @@ program ...@@ -60,12 +60,14 @@ program
) )
.argument( .argument(
'[revision]', '[revision]',
'Specify the target Next.js version using an NPM dist tag (e.g. "latest", "canary", "rc") or an exact version number (e.g. "15.0.0").', 'Specify the target Next.js version using an NPM dist tag (e.g. "latest", "canary", "rc", "beta") or an exact version number (e.g. "15.0.0").',
packageJson.version.includes('-canary.') packageJson.version.includes('-canary.')
? 'canary' ? 'canary'
: packageJson.version.includes('-rc.') : packageJson.version.includes('-rc.')
? 'rc' ? 'rc'
: 'latest' : packageJson.version.includes('-beta.')
? 'beta'
: 'latest'
) )
.usage('[revision] [options]') .usage('[revision] [options]')
.option('--verbose', 'Verbose output', false) .option('--verbose', 'Verbose output', false)
......
...@@ -106,7 +106,7 @@ export async function runUpgrade( ...@@ -106,7 +106,7 @@ export async function runUpgrade(
'peerDependencies' in targetNextPackageJson 'peerDependencies' in targetNextPackageJson
if (!validRevision) { if (!validRevision) {
throw new BadInput( throw new BadInput(
`Invalid revision provided: "${revision}". Please provide a valid Next.js version or dist-tag (e.g. "latest", "canary", "rc", or "15.0.0").\nCheck available versions at https://www.npmjs.com/package/next?activeTab=versions.` `Invalid revision provided: "${revision}". Please provide a valid Next.js version or dist-tag (e.g. "latest", "canary", "beta", "rc", or "15.0.0").\nCheck available versions at https://www.npmjs.com/package/next?activeTab=versions.`
) )
} }
......
...@@ -96,6 +96,13 @@ async function versionPackages() { ...@@ -96,6 +96,13 @@ async function versionPackages() {
}) })
break break
} }
case 'beta': {
// Enter pre mode as "beta" tag.
await execa('pnpm', ['changeset', 'pre', 'enter', 'beta'], {
stdio: 'inherit',
})
break
}
case 'stable': { case 'stable': {
// No additional steps needed for 'stable' releases since we've already // No additional steps needed for 'stable' releases since we've already
// exited any pre-release mode. Only need to run `changeset version` after. // exited any pre-release mode. Only need to run `changeset version` after.
......
...@@ -11,13 +11,17 @@ async function main() { ...@@ -11,13 +11,17 @@ async function main() {
const semverType = args[args.indexOf('--semver-type') + 1] const semverType = args[args.indexOf('--semver-type') + 1]
const isCanary = releaseType === 'canary' const isCanary = releaseType === 'canary'
const isReleaseCandidate = releaseType === 'release-candidate' const isReleaseCandidate = releaseType === 'release-candidate'
const isBeta = releaseType === 'beta'
if ( if (
releaseType !== 'stable' && releaseType !== 'stable' &&
releaseType !== 'canary' && releaseType !== 'canary' &&
releaseType !== 'release-candidate' releaseType !== 'release-candidate' &&
releaseType !== 'beta'
) { ) {
console.log(`Invalid release type ${releaseType}, must be stable or canary`) console.log(
`Invalid release type ${releaseType}, must be stable, canary, release-candidate, or beta`
)
return return
} }
if (!isCanary && !SEMVER_TYPES.includes(semverType)) { if (!isCanary && !SEMVER_TYPES.includes(semverType)) {
...@@ -71,7 +75,9 @@ async function main() { ...@@ -71,7 +75,9 @@ async function main() {
? `pnpm lerna version ${preleaseType} --preid canary --force-publish -y && pnpm release --pre --skip-questions --show-url` ? `pnpm lerna version ${preleaseType} --preid canary --force-publish -y && pnpm release --pre --skip-questions --show-url`
: isReleaseCandidate : isReleaseCandidate
? `pnpm lerna version ${preleaseType} --preid rc --force-publish -y && pnpm release --pre --skip-questions --show-url` ? `pnpm lerna version ${preleaseType} --preid rc --force-publish -y && pnpm release --pre --skip-questions --show-url`
: `pnpm lerna version ${semverType} --force-publish -y`, : isBeta
? `pnpm lerna version ${preleaseType} --preid beta --force-publish -y && pnpm release --pre --skip-questions --show-url`
: `pnpm lerna version ${semverType} --force-publish -y`,
{ {
stdio: 'pipe', stdio: 'pipe',
shell: true, shell: true,
......
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