-
Notifications
You must be signed in to change notification settings - Fork 73
fix(ci): add publishing tags step when publishing auxiliary packages MONGOSH-1871 #2332
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
Conversation
lerna publish doesn't automatically push tags when using from-package so we have to create and push the tags manually.
@@ -58,3 +58,10 @@ jobs: | |||
npm config list | |||
echo "Publishing packages as $(npm whoami)" | |||
npm run publish-auxiliary | |||
|
|||
- name: "Publish tags" |
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.
essentially same as https://github.com/mongodb-js/compass/blob/main/.github/workflows/publish-packages.yaml#L60 with one adjustment to not push tags for mongosh
in this case
- name: "Publish tags" | ||
run: | | ||
npx lerna list -a --json | \ | ||
jq -r '.[] | select(.name != "mongosh") | .name + "@" + .version' | \ |
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.
Is mongosh
excluded here because it's not scoped with @mongosh/
? Maybe add a comment or even a test somewhere that reminds people to update this line if that ever changes
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.
I am excluding it here as it is the publishing auxiliary packages which would mean it'd try to publish [email protected]
multiple times and make the tag meaningless.
Come to think of it, it'd be trivial to extract this to a function as well and make this distinction easier to reason about (and test/enforce) so I'll do that. It'd be a good test for the release git run also as I'm not 100% on how well it can access git.
f54ec3f
to
d464fa2
Compare
@@ -22,6 +23,7 @@ export async function publishMongosh( | |||
barque: Barque, | |||
createAndPublishDownloadCenterConfig: typeof createAndPublishDownloadCenterConfigFn, | |||
publishToNpm: typeof publishToNpmType, | |||
pushTags: typeof pushTagsType, |
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.
these helper functions are getting out of hand and only seem to exist for the purpose of spying/stubbing with sinon. I am keeping same structure here but think it'd be good to wrap them in a namespace or something in the future.
Includes tests and remote checking of tags.
d464fa2
to
de6927b
Compare
8429e3b
to
2e32552
Compare
2e32552
to
0f85b12
Compare
lerna publish doesn't automatically push tags when using from-package so we have to create and push the tags manually.
This is different from releasing mongosh as it does its own tag push already (without
mongosh@
prefix):mongosh/packages/build/src/npm-packages/publish.ts
Lines 59 to 73 in e0a051c