-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Migrate prepare-release-from-ci to new workflow #20581
Conversation
const compressedPackages = readdirSync(join(cwd, 'build/node_modules/')); | ||
for (let i = 0; i < compressedPackages.length; i++) { | ||
await exec( | ||
`tar zxvf ./build/node_modules/${compressedPackages[i]} -C ./build/node_modules/`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this was originally added, we didn't store the entire build directory as a CI artifact. Just the npm packages.
The reason we stored each module as an individual tarball was because we ran npm pack
to run any npm pre-processing, like filtering files out based on the package.files
array. The build script already does this, though, so we can skip the extra step.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 6ea9ed6:
|
What's the main motivation for this change? Seems like that's a nice safeguard, though it's admittedly not totally necessary. What additional benefit do we get from publishing from CI? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
const channel = params.releaseChannel; | ||
if (channel !== 'experimental' && channel !== 'stable') { | ||
console.error( | ||
`Invalid release channel: "${channel}". Must be "stable" or "experimental".` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May help clarify a tad to call out the param name too?
`Invalid release channel: "${channel}". Must be "stable" or "experimental".` | |
`Invalid release channel (-r) "${channel}". Must be "stable" or "experimental".` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better still to follow precedent here and add this validation into parse-params.js
e.g.
react/scripts/release/publish-commands/parse-params.js
Lines 35 to 46 in a656ace
params.tags.forEach(tag => { | |
switch (tag) { | |
case 'latest': | |
case 'next': | |
case 'experimental': | |
case 'untagged': | |
break; | |
default: | |
console.error('Unknown tag: "' + params.tag + '"'); | |
process.exit(1); | |
break; | |
} |
Not much other than fewer things to maintain, or accidentally subtly break. |
I added a `--releaseChannel (-r)` argument to script. You must choose either "stable" or "experimental", because every build job now includes both channels. The prepare-release-from-npm script is unchanged since those releases are downloaded from npm, nt CI. (As a side note, I think we should start preparing semver releases using the prepare-release-from-ci script, too, and get rid of prepare-release-from-npm. I think that was a neat idea originally but because we already run `npm pack` before storing the artifacts in CI, there's really not much additional safety; the only safeguard it adds is the requirement that a "next" release must have already been published.)
3a0bf84
to
6ea9ed6
Compare
Is the goal for this to eventually support |
// Download and extract artifact | ||
await exec(`rm -rf ./build2`, {cwd}); | ||
await exec( | ||
`curl -L $(fwdproxy-config curl) ${buildArtifacts.url} | tar -xvz`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @acdlite I'm trying to execute this script on a Windows machine and it looks like it assumes Unix heavily. I'm trying to rewrite this in a more xplat fashion, but I can't figure out what fwdproxy-config curl
is or returns. If you could point me to the package that enables this command or something, that'd be great. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acdlite friendly ping
* Migrate prepare-release-from-ci to new workflow I added a `--releaseChannel (-r)` argument to script. You must choose either "stable" or "experimental", because every build job now includes both channels. The prepare-release-from-npm script is unchanged since those releases are downloaded from npm, nt CI. (As a side note, I think we should start preparing semver releases using the prepare-release-from-ci script, too, and get rid of prepare-release-from-npm. I think that was a neat idea originally but because we already run `npm pack` before storing the artifacts in CI, there's really not much additional safety; the only safeguard it adds is the requirement that a "next" release must have already been published.) * Move validation to parse-params module
I added a
--releaseChannel
(-r
) argument to the script. You must choose either "stable" or "experimental", because every build job now includes both channels.The prepare-release-from-npm script is unchanged since those releases are downloaded from npm, not CI.
(As a side note, I think we should start preparing semver releases using the prepare-release-from-ci script, too, and get rid of prepare-release-from-npm. I think downloading from npm was a neat idea originally, but because we already run
npm pack
before storing the artifacts in CI, there's really not much additional safety; the only safeguard it adds is the requirement that a "next" release must have already been published.)Test plan
Prepare a stable release:
Prepare an experimental release: