Skip to content

Commit

Permalink
Support @latest in prepare-release-from-ci (#21616)
Browse files Browse the repository at this point in the history
Since we track these versions in source, we can build `@latest`
releases in CI and store them as artifacts.

Then when it's time to release, and the build has been verified, we use
`prepare-release-from-ci` (the same script we use for `@next` and
`@experimental`) to fetch the already built and versioned packages.
  • Loading branch information
acdlite committed Jun 3, 2021
1 parent 8f37942 commit 7747a56
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion scripts/release/prepare-release-from-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ const run = async () => {
await testPackagingFixture(params);
}

await printPrereleaseSummary(params, false);
const isLatestRelease = params.releaseChannel === 'latest';
await printPrereleaseSummary(params, isLatestRelease);
} catch (error) {
handleError(error);
}
Expand Down
3 changes: 3 additions & 0 deletions scripts/release/shared-commands/download-build-artifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ const run = async ({build, cwd, releaseChannel}) => {
await exec(`rm -rf ./build/node_modules`, {cwd});
}
let sourceDir;
// TODO: Rename release channel to `next`
if (releaseChannel === 'stable') {
sourceDir = 'oss-stable';
} else if (releaseChannel === 'experimental') {
sourceDir = 'oss-experimental';
} else if (releaseChannel === 'latest') {
sourceDir = 'oss-stable-semver';
} else {
console.error('Internal error: Invalid release channel: ' + releaseChannel);
process.exit(releaseChannel);
Expand Down
10 changes: 7 additions & 3 deletions scripts/release/shared-commands/parse-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,21 @@ const paramDefinitions = [
name: 'releaseChannel',
alias: 'r',
type: String,
description: 'Release channel (stable or experimental)',
description: 'Release channel (stable, experimental, or latest)',
},
];

module.exports = async () => {
const params = commandLineArgs(paramDefinitions);

const channel = params.releaseChannel;
if (channel !== 'experimental' && channel !== 'stable') {
if (
channel !== 'experimental' &&
channel !== 'stable' &&
channel !== 'latest'
) {
console.error(
theme.error`Invalid release channel (-r) "${channel}". Must be "stable" or "experimental".`
theme.error`Invalid release channel (-r) "${channel}". Must be "stable", "experimental", or "latest".`
);
process.exit(1);
}
Expand Down

0 comments on commit 7747a56

Please sign in to comment.