-
Notifications
You must be signed in to change notification settings - Fork 161
ci: automate setting npm tags #2803
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
base: main
Are you sure you want to change the base?
Conversation
.ado/scripts/prepublish-check.mjs
Outdated
| console.log(`##vso[task.setvariable variable=additionalTags]${tagsValue}`); | ||
| // GitHub Actions | ||
| if (process.env["GITHUB_OUTPUT"]) { | ||
| fs.appendFileSync(process.env["GITHUB_OUTPUT"], `additionalTags=${tagsValue}\n`); |
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.
What is this line supposed to do? GITHUB_OUTPUT is an env var. Why are we writing to it as if it's a file?
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.
Apparently, it's actually an "environment file", that contains key value pairs
2b75d5a to
c9835c3
Compare
| log(`Expected npm tag: ${tag}`); | ||
| return { npmTag: tag }; | ||
| // When promoting to latest, also add the version-specific stable tag | ||
| const versionTag = "v" + branch; |
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.
Drop the v prefix?
| // If we're demoting a branch, we will need to create a new tag. This will | ||
| // make Nx trip if we don't specify a fallback. In all other scenarios, the | ||
| // tags should exist and therefore prefer it to fail. |
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.
Did Nx fix this? Whenever we publish a new minor, wouldn't this still trigger?
Summary:
One part of our publish process we have not yet automated is setting the
v0.xx-stableandnexttags when a new release is promoted or demoted. Let's automate this by specifying additional tags in our CI that should be set when we publish a release. Now, a newlatestor patch tolatestwill also always set is0.xx-stabletag.Note: Previously, if
0.xxwas tagged aslatest, we would not have had av0.xx-stabletag. Now we will always have bothlatestand the0.xx-stabletag.Test Plan:
I duplicated this change to #2800 and #2801 . We can look at the dry run output for both to make sure release is behaving as expected.