Great post, thanks! I have one question, however: did you find a way to increment the package.json version automatically? I keep on forgetting, and it makes the pipeline fail (because npm publish an already existing tag)
I see the benefit of that and did some research into it, but I haven't done it for any of my projects because to me, there's some value in the fact that it makes me manually set the build number because it keeps me from auto-incrementing a patch number on something that should be called a minor version upgrade or a major version upgrade. After a couple weeks, I've gotten in the habit of upgrading the build number.
Great post, thanks! I have one question, however: did you find a way to increment the package.json version automatically? I keep on forgetting, and it makes the pipeline fail (because npm publish an already existing tag)
Yes and no.
I see the benefit of that and did some research into it, but I haven't done it for any of my projects because to me, there's some value in the fact that it makes me manually set the build number because it keeps me from auto-incrementing a patch number on something that should be called a minor version upgrade or a major version upgrade. After a couple weeks, I've gotten in the habit of upgrading the build number.
Take a look at this GitLab CI script, though. It shows how to autoincrement and save an env variable.
That's a good point. Thanks :)