Commit 2ea60eff authored by Kenton Varda's avatar Kenton Varda

Create a script that builds the release.

parent 0792ee4e
How to release How to release
============== ==============
* Check out the master branch in a fresh directory. Do NOT use your regular repo, as the release
script commits changes and if anything goes wrong you'll probably want to trash the whole thing
without pushing.
* Run `super-test.sh` on as many platforms as you have available. Remember that you can easily run * Run `super-test.sh` on as many platforms as you have available. Remember that you can easily run
on any machine available through ssh using `./super-test.sh remote [hostname]`. Also run in on any machine available through ssh using `./super-test.sh remote [hostname]`. Also run in
clang mode. clang mode.
* Create a new release branch, named release-VERSION, where VERSION is the current version number * Run `./release.sh candidate`. This creates a new release branch, updates the version number to
except with `-dev` replaced by `.0`. E.g. 1.1-dev becomes 1.1.0. `-rc1`, builds release tarballs, copies them to the current directory, then switches back to the
master branch and bumps the version number there.
* In the master branch, bump the minor version number.
* In the release branch, change the version numbers in both `c++/configure.ac` and
`compiler/capnproto-compiler.cabal`, replacing `-dev` with `.0-rc1`. So, e.g., 1.1-dev becomes
1.1.0-rc1.
* Under the `compiler` directory, run `cabal sdist` to build a release candidate tarball.
* Under the `c++` directory, use `make distcheck` to build a release candidate tarball. * Install your release candidates on your local machine, as if you were a user.
* Install your release candidates on your local machine.
* Go to `c++/samples` in the git repo and run `./test.sh`. It will try to build against your * Go to `c++/samples` in the git repo and run `./test.sh`. It will try to build against your
installed copy. installed copy.
* Push changes to git for both the master and release branches.
* Post the release candidates somewhere public and then send links to the mailing list for people * Post the release candidates somewhere public and then send links to the mailing list for people
to test. Wait a bit for bug reports. to test. Wait a bit for bug reports.
* If there are any problems, fix them and start a new release candidate `-rc2`, repeating the * If there are any problems, fix them in master and start a new release candidate by running
instructions above, and so on until the problem is fixed. Make sure to cherry-pick any changes `./release.sh candidate <commit>...` from the release branch. This will cherry-pick the specified
from the release branch back into the mainline. commits into the release branch and create a new candidate. Repeat until all problems are fixed.
Be sure that any such fixes include tests or process changes so that they don't happen again.
* You should now be ready for an official release. Run `./release.sh final`.
* You should now be ready for an official release. Remove the `-rcN` suffix from the verison * Upload the files and update the download links on the web site.
number and rebuild the release packages one last time. Post these publicly and update the links
on the site.
* Write and publish a blog post discussing what is new. * Write and publish a blog post discussing what is new.
* Submit the blog post to Hacker News and other places. * Submit the blog post to news sites and social media as you see fit.
* If problems are discovered in the release, make a new release branch forked from the current one * If problems are discovered in the release, fix them in master and run
(not from master) with the micro version incremented by one and fix the problems there. Repeat `./release.sh candidate <commit>...` in the release branch to start a new micro release. The
the release candidate process if the changes are complicated, or skip it and just publish if the script automatically sees that the current branch's version no longer contains `-rc`, so it starts
release is simple and obvious. Blog posts are usually not warranted for minor bugfix releases, a new branch. Repeat the rest of the process above. Blog posts are usually not warranted for
but the people reporting the bug should of course be told of the fix. Be sure to cherry-pick the minor bugfix releases, but the people reporting the bug should of course be told of the fix.
fix back into the mainline. If at all possible, include a test with your fix so that it doesn't
happen again. The test may be a unit test, an extension of `super-test.sh`, or a new step in the
release process.
## Process this file with autoconf to produce configure. ## Process this file with autoconf to produce configure.
AC_INIT([Capn Proto],[0.1-dev],[capnproto@googlegroups.com],[capnproto]) AC_INIT([Capn Proto],[0.1-dev],[capnproto@googlegroups.com],[capnproto-c++])
AC_CONFIG_SRCDIR([src/capnp/layout.c++]) AC_CONFIG_SRCDIR([src/capnp/layout.c++])
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
......
#! /bin/bash
set -euo pipefail
doit() {
echo "@@@@ $@"
"$@"
}
BRANCH=$(git rev-parse --abbrev-ref HEAD)
case "$BRANCH" in
master )
if [ "x${1:-}" != xcandidate ]; then
echo "Parameter must be 'candidate' when starting from master branch." >&2
exit 1
fi
echo "New major release."
VERSION=$(grep AC_INIT c++/configure.ac | sed -e 's/^.*],\[\([^]]*\)-dev].*$/\1/g')
echo "Version: $VERSION.0"
echo "========================================================================="
echo "Creating release branch..."
echo "========================================================================="
doit git checkout -b release-$VERSION.0
VERSION_REGEX=${VERSION/./[.]}-dev
doit sed -i -e "s/$VERSION_REGEX/$VERSION.0-rc1/g" c++/configure.ac compiler/capnproto-compiler.cabal
doit git commit -a -m "Set release branch version to $VERSION.0-rc1."
echo "========================================================================="
echo "Building compiler package..."
echo "========================================================================="
cd compiler
doit cabal configure
doit cabal sdist
doit cp dist/capnproto-compiler-$VERSION.0.tar.gz ../capnproto-compiler-$VERSION.0-rc1.tar.gz
doit cabal clean
cd ..
echo "========================================================================="
echo "Building C++ runtime package..."
echo "========================================================================="
cd c++
doit ./setup-autotools.sh
doit autoreconf -i
doit ./configure
doit make dist
doit cp capnproto-c++-$VERSION.0-rc1.tar.gz ..
doit make maintainer-clean
cd ..
echo "========================================================================="
echo "Updating version in master branch..."
echo "========================================================================="
doit git checkout master
declare -a VERSION_ARR=(${VERSION/./ })
NEXT_VERSION=${VERSION_ARR[0]}.$((VERSION_ARR[1] + 1))
doit sed -i -e "s/$VERSION_REGEX/$NEXT_VERSION-dev/g" c++/configure.ac compiler/capnproto-compiler.cabal
doit git commit -a -m "Set mainline version to $NEXT_VERSION-dev."
echo "========================================================================="
echo "Done"
echo "========================================================================="
echo "Ready to release:"
echo " capnproto-compiler-$VERSION.0-rc1.tar.gz"
echo " capnproto-c++-$VERSION.0-rc1.tar.gz"
echo "Don't forget to push changes:"
echo " git push origin master release-$VERSION.0"
;;
release-* )
if [ "x${1:-}" == xcandidate ]; then
echo "New release candidate."
echo "NOT IMPLEMENTED" >&2
exit 1
elif [ "x${1:-}" == xfinal ]; then
echo "Final release."
echo "NOT IMPLEMENTED" >&2
exit 1
else
echo "Parameter must be either 'candidate' or 'final'." >&2
exit 1
fi
;;
* )
echo "Not a master or release branch." >&2
exit 1
esac
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment