@samitouri / QOS-React-2 / commits / 7747a5684d

Support `@latest` in prepare-release-from-ci (#21616)

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.

Andrew Clark committed Jun 3, 2021 at 14:00 UTC 7747a5684d0d4c482081cad4e8b715d35fb97dd2
3 files changed +12 -4
scripts/release/prepare-release-from-ci.js
+2 -1
@@ -23,7 +23,8 @@ const run = async () => {
23 await testPackagingFixture(params);
24 }
25
26 - await printPrereleaseSummary(params, false);
26 + const isLatestRelease = params.releaseChannel === 'latest';
27 + await printPrereleaseSummary(params, isLatestRelease);
28 } catch (error) {
29 handleError(error);
30 }
scripts/release/shared-commands/download-build-artifacts.js
+3
@@ -39,10 +39,13 @@ const run = async ({build, cwd, releaseChannel}) => {
39 await exec(`rm -rf ./build/node_modules`, {cwd});
40 }
41 let sourceDir;
42 + // TODO: Rename release channel to `next`
43 if (releaseChannel === 'stable') {
44 sourceDir = 'oss-stable';
45 } else if (releaseChannel === 'experimental') {
46 sourceDir = 'oss-experimental';
47 + } else if (releaseChannel === 'latest') {
48 + sourceDir = 'oss-stable-semver';
49 } else {
50 console.error('Internal error: Invalid release channel: ' + releaseChannel);
51 process.exit(releaseChannel);
scripts/release/shared-commands/parse-params.js
+7 -3
@@ -32,7 +32,7 @@ const paramDefinitions = [
32 name: 'releaseChannel',
33 alias: 'r',
34 type: String,
35 - description: 'Release channel (stable or experimental)',
35 + description: 'Release channel (stable, experimental, or latest)',
36 },
37 ];
38
@@ -40,9 +40,13 @@ module.exports = async () => {
40 const params = commandLineArgs(paramDefinitions);
41
42 const channel = params.releaseChannel;
43 - if (channel !== 'experimental' && channel !== 'stable') {
43 + if (
44 + channel !== 'experimental' &&
45 + channel !== 'stable' &&
46 + channel !== 'latest'
47 + ) {
48 console.error(
45 - theme.error`Invalid release channel (-r) "${channel}". Must be "stable" or "experimental".`
49 + theme.error`Invalid release channel (-r) "${channel}". Must be "stable", "experimental", or "latest".`
50 );
51 process.exit(1);
52 }