Creating GitHub Releases from git Tags

Published: | by Julian Knight Reading time ~1 min.
📖 Posts | 📎 Development | 🔖 git, github, npm, node.js, nodejs

The workflow for updating version numbers and doing git/GitHub/npm releases is far too complex to easily remember when you aren’t doing it very often. This post is a reminder of the various steps.

Just a quick reminder for myself mainly.

GitHub will automatically create a release from a git tag. Having had a request for this from an issue with node-red-contrib-uibuilder, I decided that I’d better look into how to do it.

Why is everything harder than it should be!? Anyway, here is the raw workflow for committing changes to a git managed repository of code, creating a tag, pushing both master and the tag to GitHub and then publishing to npm.

# This could be minor or major instead of patch, it updates package.js
npm npm version patch -m "Patch version bump to %s"
# We might want to stage instead of committing everything at once
git commit -m "Commit message"
git push
# Create a tag to match the npm version
git tag -a v1.4.1 -m "my version 1.4.1"
git push origin --tags
# Publish to npm
npm publish

Of course, the commit and push are easier done direct from VScode.

It is annoying that I can’t link the tag to the npm version.

References 🔗︎

comments powered by Disqus