MCPcopy Index your code
hub / github.com/tensorflow/tfjs / main

Function main

scripts/release.ts:44–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42});
43
44async function main() {
45 const args = parser.parseArgs();
46
47 // The alpha release unit is released with the monorepo and should not be
48 // released by this script. Packages in the alpha release unit need their
49 // package.json dependencies rewritten.
50 const releaseUnits = RELEASE_UNITS.filter(r => r !== ALPHA_RELEASE_UNIT);
51 releaseUnits.forEach(printReleaseUnit);
52 console.log();
53
54 const releaseUnitStr =
55 await question('Which release unit (leave empty for 0): ');
56 const releaseUnitInt = +releaseUnitStr;
57 if (releaseUnitInt < 0 || releaseUnitInt >= releaseUnits.length) {
58 console.log(chalk.red(`Invalid release unit: ${releaseUnitStr}`));
59 process.exit(1);
60 }
61 console.log(chalk.blue(`Using release unit ${releaseUnitInt}`));
62 console.log();
63
64 const releaseUnit = releaseUnits[releaseUnitInt];
65 const {name, phases} = releaseUnit;
66
67 phases.forEach((_, i) => printPhase(phases, i));
68 console.log();
69
70 const phaseStr = await question('Which phase (leave empty for 0): ');
71 const phaseInt = +phaseStr;
72 if (phaseInt < 0 || phaseInt >= phases.length) {
73 console.log(chalk.red(`Invalid phase: ${phaseStr}`));
74 process.exit(1);
75 }
76 console.log(chalk.blue(`Using phase ${phaseInt}`));
77 console.log();
78
79 const phase = phases[phaseInt];
80 const packages = phases[phaseInt].packages;
81 const deps = phases[phaseInt].deps || [];
82
83 if (releaseUnit === WEBSITE_RELEASE_UNIT) {
84 await releaseWebsite(args);
85
86 console.log(
87 'Done. Please remember to deploy the website once you merged the PR.');
88
89 process.exit(0);
90 }
91
92 // Release packages in tfjs repo.
93 const dir = `${TMP_DIR}/tfjs`;
94 makeReleaseDir(dir);
95
96 const urlBase = args.git_protocol ? 'git@github.com:' : 'https://github.com/';
97 let releaseBranch = '';
98
99 if (phaseInt !== 0) {
100 // Phase0 should be published and release branch should have been created.
101 const firstPackageVersions: string[] = JSON.parse(

Callers 1

release.tsFile · 0.70

Calls 12

questionFunction · 0.90
printPhaseFunction · 0.90
releaseWebsiteFunction · 0.90
makeReleaseDirFunction · 0.90
$Function · 0.90
getPatchUpdateVersionFunction · 0.90
updateDependencyFunction · 0.90
prepareReleaseBuildFunction · 0.90
createPRFunction · 0.90
joinMethod · 0.80
logMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…