3

I'm using the following resources as a guide to git flow:

However, none of them explicitly mention at what point you perform the npm publish from. Do you do this after you have bumped the version number but before you finish the release? This would mean the publish is coming from the release branch. Or do you finish the release then perform the publish from the master branch?

Thanks.

1 Answer 1

4

I'd set up my CI system to do this on every commit to master, that is, after the release branch merges.

The first very straightforward reason for this is that the commit to master gets tagged with the release, and you want the thing you ultimately publish to match exactly the version of the source code at the tag. While there shouldn't be any merge surprises if git flow is run perfectly, it's still better to publish the content of a tag and not the commit immediately before a merge.

The second reason is that it is a very simple rule that can be automated. If you do any amount of final testing on the release branch, you need to make a manual decision as to whether or not you can release or not; your CI system (probably) can't make that decision just based on the presence of a release branch. On the other hand, since every commit to master is merging in a release (or hotfix) branch that you've fully validated, the commit itself is a signal that you're ready to release.

1
  • Thanks David, that makes sense. I haven't got a deployment step in my worflow yet, but when I get round to doig that, would I be right to assume that the deploy should also be inline with the publish done after the release is 'finished' from 'master' as you say.
    – Plastikfan
    Commented Dec 16, 2019 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.