Skip to content

Commit 70885cf

Browse files
committed
[ci] Cleanup forked build files
Unforks these scripts now that we are fully migrated to GH. ghstack-source-id: e1e1545 Pull Request resolved: facebook#30506
1 parent 6b82f3c commit 70885cf

11 files changed

+148
-1130
lines changed

.github/workflows/devtools_regression_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Download react-devtools artifacts for base revision
3838
run: |
3939
git fetch origin main
40-
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=$(git rev-parse origin/main)
40+
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
4141
- name: Display structure of build
4242
run: ls -R build
4343
- name: Archive build

.github/workflows/runtime_build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ jobs:
549549
- name: Download artifacts for base revision
550550
run: |
551551
git fetch origin main
552-
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=$(git rev-parse origin/main)
552+
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
553553
mv ./build ./base-build
554554
# TODO: The `download-experimental-build` script copies the npm
555555
# packages into the `node_modules` directory. This is a historical

.github/workflows/runtime_commit_artifacts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
working-directory: scripts/release
7373
- name: Download artifacts for base revision
7474
run: |
75-
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=${{ github.event.workflow_run.head_sha }}
75+
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ github.event.workflow_run.head_sha }}
7676
- name: Display structure of build
7777
run: ls -R build
7878
- name: Strip @license from eslint plugin and react-refresh

scripts/release/download-experimental-build-ghaction.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

scripts/release/download-experimental-build.js

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,58 @@
22

33
'use strict';
44

5-
const {join} = require('path');
5+
const {join, relative} = require('path');
6+
const {handleError} = require('./utils');
7+
const yargs = require('yargs');
8+
const clear = require('clear');
9+
const theme = require('./theme');
610
const {
7-
addDefaultParamValue,
8-
getPublicPackages,
9-
handleError,
10-
} = require('./utils');
11-
12-
const downloadBuildArtifacts = require('./shared-commands/download-build-artifacts');
13-
const parseParams = require('./shared-commands/parse-params');
14-
const printSummary = require('./download-experimental-build-commands/print-summary');
15-
16-
const run = async () => {
11+
downloadBuildArtifacts,
12+
} = require('./shared-commands/download-build-artifacts');
13+
14+
const argv = yargs.wrap(yargs.terminalWidth()).options({
15+
releaseChannel: {
16+
alias: 'r',
17+
describe: 'Download the given release channel.',
18+
requiresArg: true,
19+
type: 'string',
20+
choices: ['experimental', 'stable'],
21+
default: 'experimental',
22+
},
23+
commit: {
24+
alias: 'c',
25+
describe: 'Commit hash to download.',
26+
requiresArg: true,
27+
demandOption: true,
28+
type: 'string',
29+
},
30+
}).argv;
31+
32+
function printSummary(commit) {
33+
const commandPath = relative(
34+
process.env.PWD,
35+
join(__dirname, '../download-experimental-build.js')
36+
);
37+
38+
clear();
39+
40+
const message = theme`
41+
{caution An experimental build has been downloaded!}
42+
43+
You can download this build again by running:
44+
{path ${commandPath}} --commit={commit ${commit}}
45+
`;
46+
47+
console.log(message.replace(/\n +/g, '\n').trim());
48+
}
49+
50+
const main = async () => {
1751
try {
18-
addDefaultParamValue('-r', '--releaseChannel', 'experimental');
19-
20-
const params = await parseParams();
21-
params.cwd = join(__dirname, '..', '..');
22-
params.packages = await getPublicPackages(true);
23-
24-
await downloadBuildArtifacts(params);
25-
26-
printSummary(params);
52+
await downloadBuildArtifacts(argv.commit, argv.releaseChannel);
53+
printSummary(argv.commit);
2754
} catch (error) {
2855
handleError(error);
2956
}
3057
};
3158

32-
run();
59+
main();

scripts/release/prepare-release-from-ci.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const {addDefaultParamValue, handleError} = require('./utils');
77

88
const {
99
downloadBuildArtifacts,
10-
} = require('./shared-commands/download-build-artifacts-ghaction');
10+
} = require('./shared-commands/download-build-artifacts');
1111
const parseParams = require('./shared-commands/parse-params');
1212
const printPrereleaseSummary = require('./shared-commands/print-prerelease-summary');
1313
const testPackagingFixture = require('./shared-commands/test-packaging-fixture');

scripts/release/shared-commands/download-build-artifacts-ghaction.js

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)