Skip to content

Commit

Permalink
[ci] Cleanup forked build files
Browse files Browse the repository at this point in the history
Unforks these scripts now that we are fully migrated to GH.

ghstack-source-id: e1e15452f2d2e178a5b56203ebd0b42151e6a9ba
Pull Request resolved: #30506
  • Loading branch information
poteto committed Jul 29, 2024
1 parent 6b82f3c commit 70885cf
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 1,130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/devtools_regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Download react-devtools artifacts for base revision
run: |
git fetch origin main
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=$(git rev-parse origin/main)
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
- name: Display structure of build
run: ls -R build
- name: Archive build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runtime_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ jobs:
- name: Download artifacts for base revision
run: |
git fetch origin main
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=$(git rev-parse origin/main)
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
mv ./build ./base-build
# TODO: The `download-experimental-build` script copies the npm
# packages into the `node_modules` directory. This is a historical
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runtime_commit_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
working-directory: scripts/release
- name: Download artifacts for base revision
run: |
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build-ghaction.js --commit=${{ github.event.workflow_run.head_sha }}
GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ github.event.workflow_run.head_sha }}
- name: Display structure of build
run: ls -R build
- name: Strip @license from eslint plugin and react-refresh
Expand Down
59 changes: 0 additions & 59 deletions scripts/release/download-experimental-build-ghaction.js

This file was deleted.

69 changes: 48 additions & 21 deletions scripts/release/download-experimental-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,58 @@

'use strict';

const {join} = require('path');
const {join, relative} = require('path');
const {handleError} = require('./utils');
const yargs = require('yargs');
const clear = require('clear');
const theme = require('./theme');
const {
addDefaultParamValue,
getPublicPackages,
handleError,
} = require('./utils');

const downloadBuildArtifacts = require('./shared-commands/download-build-artifacts');
const parseParams = require('./shared-commands/parse-params');
const printSummary = require('./download-experimental-build-commands/print-summary');

const run = async () => {
downloadBuildArtifacts,
} = require('./shared-commands/download-build-artifacts');

const argv = yargs.wrap(yargs.terminalWidth()).options({
releaseChannel: {
alias: 'r',
describe: 'Download the given release channel.',
requiresArg: true,
type: 'string',
choices: ['experimental', 'stable'],
default: 'experimental',
},
commit: {
alias: 'c',
describe: 'Commit hash to download.',
requiresArg: true,
demandOption: true,
type: 'string',
},
}).argv;

function printSummary(commit) {
const commandPath = relative(
process.env.PWD,
join(__dirname, '../download-experimental-build.js')
);

clear();

const message = theme`
{caution An experimental build has been downloaded!}
You can download this build again by running:
{path ${commandPath}} --commit={commit ${commit}}
`;

console.log(message.replace(/\n +/g, '\n').trim());
}

const main = async () => {
try {
addDefaultParamValue('-r', '--releaseChannel', 'experimental');

const params = await parseParams();
params.cwd = join(__dirname, '..', '..');
params.packages = await getPublicPackages(true);

await downloadBuildArtifacts(params);

printSummary(params);
await downloadBuildArtifacts(argv.commit, argv.releaseChannel);
printSummary(argv.commit);
} catch (error) {
handleError(error);
}
};

run();
main();
2 changes: 1 addition & 1 deletion scripts/release/prepare-release-from-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {addDefaultParamValue, handleError} = require('./utils');

const {
downloadBuildArtifacts,
} = require('./shared-commands/download-build-artifacts-ghaction');
} = require('./shared-commands/download-build-artifacts');
const parseParams = require('./shared-commands/parse-params');
const printPrereleaseSummary = require('./shared-commands/print-prerelease-summary');
const testPackagingFixture = require('./shared-commands/test-packaging-fixture');
Expand Down
136 changes: 0 additions & 136 deletions scripts/release/shared-commands/download-build-artifacts-ghaction.js

This file was deleted.

Loading

0 comments on commit 70885cf

Please sign in to comment.