Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Cleanup forked build files #30506

Merged
merged 10 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading