Skip to content

Commit

Permalink
Use atomic git push during release process
Browse files Browse the repository at this point in the history
Ensure that the release tag is only pushed to GitHub if the release
commit can also be pushed to master.

We are likely to change the release process soon to avoid the need to
push to master at all (see #810)
but in the meantime this prevents a scenario where:

 - A tag vX.Y.Z gets created
 - The package version is still at X.Y.(Z-1) on master
 - Subsequent builds of master fail because they try and fail to create
   a tag vX.Y.Z which already exists
  • Loading branch information
robertknight committed Nov 8, 2018
1 parent bdf7f6b commit c0ee3d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/postversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ fi

# nb. The remote refname is fully qualified because this script is run in a CI
# environment where not all heads may have been fetched.
git push https://github.com/hypothesis/client.git HEAD:refs/heads/$BRANCH_NAME --follow-tags
git push https://github.com/hypothesis/client.git HEAD:refs/heads/$BRANCH_NAME \
--follow-tags --atomic

# Wait a moment to give GitHub a chance to realize that the tag exists
sleep 2
Expand Down

0 comments on commit c0ee3d9

Please sign in to comment.