-
Notifications
You must be signed in to change notification settings - Fork 332
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
Generate NPM tag within publish-release bash script #2635
Conversation
dabed4e
to
b2546e9
Compare
This is really neat – great idea 🙌🏻 At the risk of bike-shedding, I think e.g. |
I don't think npm will let you use |
This was my first though, but what @lfdebrux said above - looks like npm advise against doing this. We could do |
If we want to release versions of GOV.UK Frontend older than the current major version, e.g: releasing a version 4.5.0. when we've already released version 5.0.0, then we need to be able to override NPM's default "tag" which tags the most recent release as "latest". Tagging v4.5.0 as "latest" would mean people doing `npm install govuk-frontend` would get v4.5.0 instead of v5.0.0. Unfortunately, the only way to NOT tag something as "latest" is to provide a different tag to tag it with. This script compares the tags on Github with the version being proposed. If the version number being proposed is smaller than the highest version tag on Github, the NPM tag will be `latest-[MAJOR-VERSION-NUMBER]` e.g: `latest-4`
b2546e9
to
3e152c9
Compare
Ahah! That all makes sense. Personally I think |
4a43a8b
to
58155f3
Compare
58155f3
to
0536e31
Compare
0fddedd
to
4b57eac
Compare
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.
One small stylistic suggestion, otherwise looks good to me!
22a4617
to
4bc2634
Compare
Part of #2004
What
Add logic to existing publish-release bash script to work out the correct NPM tag for a release before publishing it.
This also adds the option to provide a tag yourself if the suggested one doesn't suit.
Why
If we want to release versions of GOV.UK Frontend older than the current major version, e.g: releasing a version 4.5.0. when we've already released version 5.0.0, then we need to be able to override NPM's default "tag" which tags the most recent release as "latest".
Tagging v4.5.0 as "latest" would mean people doing
npm install govuk-frontend
would get v4.5.0 instead of v5.0.0.Unfortunately, the only way to NOT tag something as "latest" is to provide a different tag to tag it with. This script compares the tags on Github with the version being proposed. If the version number being proposed is smaller than the highest version tag on Github, the NPM tag will be
latest-[MAJOR-VERSION-NUMBER]
e.g:latest-4
Examples