|
| 1 | +Making a release of htslib, samtools, and bcftools, or just one or two of them, has several stages: the source control gymnastics of tagging the desired source as a release; generating the release tarballs/packages; and uploading the release to GitHub and SourceForge and publicising it. |
| 2 | + |
| 3 | +# Tagging the release |
| 4 | + |
| 5 | +We follow the [git-flow] conventions, where releases are tagged on the **master** branch. We also merge the release commit back to **develop**, so that `git describe` describes subsequent commits on the **develop** branch with respect to the newly-created latest release. |
| 6 | + |
| 7 | +[git-flow]: http://nvie.com/posts/a-successful-git-branching-model/ |
| 8 | + |
| 9 | +## Merge to master |
| 10 | + |
| 11 | +We first set up the merge commit that will eventually be tagged as the release: |
| 12 | + |
| 13 | + git checkout --track origin/master |
| 14 | + git merge --no-ff --no-commit develop |
| 15 | + |
| 16 | +but do not commit it, as version numbers etc will be bumped within the merge commit -- so that no commits prior to this one (which will eventually be the one tagged as the release) contain the bumped version number. In particular, for `H`/`S`/`B`, i.e., for HTSlib/SAMtools/BCFtools respectively, make the following edits: |
| 17 | + |
| 18 | +* `HSB` Update `PACKAGE_VERSION` in _Makefile_ |
| 19 | +* `HS ` Add to _NEWS_ |
| 20 | +* ` S ` Update version number in _README_ (on three lines) |
| 21 | +* ` S ` Update version number in _bam.h_ (removing any `+` in the string) |
| 22 | +* `HSB` Update `.TH` date and version in manual pages |
| 23 | + - `H`: _htsfile.1 tabix.1_ |
| 24 | + - `S`: _samtools.1 misc/wgsim.1_ |
| 25 | + - `B`: `make DOC_VERSION=1.X DOC_DATE=YYYY-MM-DD docs` |
| 26 | + |
| 27 | +And finally commit it: |
| 28 | + |
| 29 | + git add <various> |
| 30 | + git commit --no-verify -m 'Release X.Y.Z: summary' |
| 31 | + |
| 32 | +## Tag release commit |
| 33 | + |
| 34 | +Tag this merge commit, using "HTSlib [patch] release X.Y.Z: summary" etc as the subject line and the release notes copied from _NEWS_ as the body of the commit message. You want to use an annotated (`-a`) or ideally signed (`-s`) tag: |
| 35 | + |
| 36 | + git tag -s VERSION |
| 37 | + |
| 38 | +Keep the first (subject) line of the commit message short, so that `git tag -n` displays well in a standard-width terminal. You have 63 characters. |
| 39 | + |
| 40 | +If you are signing the tag, you may wish to prepare the message in a file and use `git tag -F msg.txt --cleanup=verbatim` so that you can preserve a trailing blank line at the end of the file to separate the `-----BEGIN PGP SIGNATURE-----` line from the release notes. |
| 41 | + |
| 42 | +If you have done this on a separate mostly-offline machine that has your private GPG key on it, pull the tag back to your usual development machine with e.g. |
| 43 | + |
| 44 | + git pull --tags host:path/to/htslib VERSION |
| 45 | + |
| 46 | +## Merge back to develop |
| 47 | + |
| 48 | +Finally, and somewhat at your leisure, merge the version number bumps etc back to the **develop** branch: |
| 49 | + |
| 50 | + git checkout develop |
| 51 | + git fetch |
| 52 | + git merge --no-ff --no-commit master |
| 53 | + |
| 54 | +* `HS ` Add new header to _NEWS_ |
| 55 | +* ` S ` Add `+` to `BAM_VERSION` in _bam.h_ |
| 56 | + |
| 57 | + git add NEWS bam.h |
| 58 | + git commit -m 'Merge version number bump and NEWS file from master' |
| 59 | + |
| 60 | + |
| 61 | +# Generate release tarballs |
| 62 | + |
| 63 | +This repository's _Makefile_ contains recipes to build release tarballs from Git repositories alongside this directory, i.e., it expects to find appropriate repositories in _../htslib_, _../samtools_, and _../bcftools_. |
| 64 | + |
| 65 | + |
| 66 | +# Uploading to GitHub and SourceForge |
| 67 | + |
| 68 | + |
| 69 | +<!-- vim:set linebreak: --> |
0 commit comments