Make sure you have hub
installed.
brew install hub
To release new versions of ThriftRW Go, follow these instructions.
-
Set up some environment variables for use later.
# The version being released. VERSION=1.2.3 # This is the branch from which $VERSION will be released. # This is almost always dev. BRANCH=dev
-
Set up a release branch. We will propose the release from this branch.
git fetch origin master git checkout -b $(whoami)/release origin/master
-
Merge changes to be released into this branch.
git merge $BRANCH
-
Verify that there are no changes to the generated code.
make generate git diff
If the diff is non-empty, abort the release and figure out why the generated code has changed.
-
Alter the Unreleased entry in CHANGELOG.md to point to
$VERSION
and update the link at the bottom of the file. Use the formatYYYY-MM-DD
for the year.-## [Unreleased] +## [1.2.3] - 2020-01-03
-[Unreleased]: https://github.com/thriftrw/thriftrw-go/compare/v1.2.2...HEAD +[1.2.3]: https://github.com/thriftrw/thriftrw-go/compare/v1.2.2...v1.2.3
-
Update the version number in version/version.go and verify that it matches what is in the changelog.
sed -i '' -e "s/^const Version =.*/const Version = \"$VERSION\"/" version/version.go make verifyversion
-
Create a commit for the release.
git add version/version.go CHANGELOG.md git commit -m "Preparing release v$VERSION"
-
Make a pull request with these changes against
master
.hub pull-request -b master --push
-
Land the pull request after approval as a merge commit. To do this, select Create a merge commit from the pull-down next to the merge button and click Merge pull request. Make sure you delete that branch after it has been merged with Delete Branch.
-
Once the change has been landed, pull it locally.
git checkout master git pull
-
Tag a release.
hub release create -o -m v$VERSION -t master v$VERSION
-
Copy the changelog entries for this release into the release description in the newly opened browser window.
-
Switch back to development.
git checkout $BRANCH git merge master
-
Add a placeholder for the next version to CHANGELOG.md and a new link at the bottom.
+## [Unreleased] +- No changes yet. + ## [1.2.3] - 2020-01-03
+[Unreleased]: https://github.com/thriftrw/thriftrw-go/compare/v1.2.3...HEAD [1.2.3]: https://github.com/thriftrw/thriftrw-go/compare/v1.2.2...v1.2.3
-
Update the version number in version/version.go to the next minor version.
-const Version = "1.2.3" +const Version = "1.3.0"
-
Verify the version number matches.
make verifyversion
-
Update the generated code.
make generate
-
Commit and push your changes.
git commit -a -m 'Back to development' git push origin $BRANCH