|
| 1 | +# Release process |
| 2 | + |
| 3 | +The release process starts with one or more release candidates, |
| 4 | +when no more blocking issues needs to be fixed a final tag is created |
| 5 | +and the final release is rolled. |
| 6 | + |
| 7 | +confluent-kafka-python uses semver versioning and loosely follows |
| 8 | +librdkafka's version, e.g. v0.11.4 for the final release and |
| 9 | +v0.11.4rc3 for the 3rd v0.11.4 release candidate. |
| 10 | + |
| 11 | +With the addition of prebuilt binary wheels we make use of travis-ci.org |
| 12 | +to build OSX and Linux binaries which are uploaded to Confluent's private |
| 13 | +S3 bucket. These artifacts are downloaded by the `tools/download-s3.py` script |
| 14 | +and then uploaded manually to PyPi. |
| 15 | + |
| 16 | +**Note**: Python package versions use a lowercase `rcN` suffix to indicate |
| 17 | + release candidates while librdkafka uses `-RCN`. The Python format |
| 18 | + must be used for confluent-kafka-python releases. |
| 19 | + That is to say that while the librdkafka RC is named `v0.11.4-RC3` |
| 20 | + a Python client RC with the same version is named `v0.11.4rc3`. |
| 21 | + |
| 22 | + |
| 23 | +The following guide uses `v0.11.4rc1` as version for a release candidate, |
| 24 | +replace as necessary with your version or remove `rc..` suffix for the |
| 25 | +final release. |
| 26 | + |
| 27 | + |
| 28 | +## 1. Update in-source versions |
| 29 | + |
| 30 | +There are a number of source files that needs to be updated with the |
| 31 | +new version number, the easiest way to find these is to search for the |
| 32 | +previous version, e.g.: `git grep 0.11` |
| 33 | +The version should be set to the final release version, even when doing |
| 34 | +RCs, so only needs to be set once for each release. |
| 35 | + |
| 36 | + * `confluent_kafka/src/confluent_kafka.c` - in the `version()` function, |
| 37 | + change both the string and the hex-representation. |
| 38 | + * `docs/conf.py` - change `release` and `version` variables. |
| 39 | + * `setup.py` - change `version` variable. |
| 40 | + |
| 41 | +Commit these changes with a commit-message containing the version: |
| 42 | + |
| 43 | + $ git commit -m "Version v0.11.4rc1" confluent_kafka/src/confluent_kafka.c docs/conf.py setup.py |
| 44 | + |
| 45 | + |
| 46 | +## 2. Create a tag |
| 47 | + |
| 48 | +The tag should be created right after the commit and be named the same as |
| 49 | +the version. |
| 50 | + |
| 51 | + $ git tag v0.11.4rc1 |
| 52 | + |
| 53 | + |
| 54 | +## 3. Push tag and commits |
| 55 | + |
| 56 | +Perform a dry-run push first to make sure the correct branch and only our tag |
| 57 | +is pushed. |
| 58 | + |
| 59 | + $ git push --dry-run --tags origin master |
| 60 | + |
| 61 | +Remove `--dry-run` when you're happy with the results. |
| 62 | + |
| 63 | +An alternative is to push branch and tags separately: |
| 64 | + |
| 65 | + $ git push --dry-run origin master |
| 66 | + $ git push --dry-run --tags origin v0.11.4rc1 |
| 67 | + |
| 68 | + |
| 69 | +## 4. Wait for CI builds |
| 70 | + |
| 71 | +Monitor travis-ci builds by looking atthe *tag* build at |
| 72 | +[travis-ci]https://travis-ci.org/confluentinc/confluent-kafka-python |
| 73 | + |
| 74 | + |
| 75 | +## 5. Download build artifacts from S3 |
| 76 | + |
| 77 | +*Note*: You will need set up your AWS credentials in `~/.aws/credentials` to |
| 78 | + gain access to the S3 bucket. |
| 79 | + |
| 80 | +When the build for all platforms are successful download the resulting |
| 81 | +artifacts from S3 using: |
| 82 | + |
| 83 | + $ cd tools |
| 84 | + $ ./download-s3.py v0.11.4rc1 # replace with your tagged version |
| 85 | + |
| 86 | +The artifacts will be downloaded to `dl-<tag>/`. |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +## 6. Verify packages |
| 91 | + |
| 92 | +Create a new virtualenv: |
| 93 | + |
| 94 | + $ rm -rf mytestenv2 |
| 95 | + $ virtualenv mytestenv2 |
| 96 | + $ source mytestenv2/bin/activate |
| 97 | + |
| 98 | +Install the relevant package for your platform: |
| 99 | + |
| 100 | + $ pip install dl-v0.11.4rc1/confluent_kafka-....whl |
| 101 | + |
| 102 | +Verify that the package works, should print the expected Python client |
| 103 | +and librdkafka versions: |
| 104 | + |
| 105 | + $ python -c 'import confluent_kafka as ck ; print "py:", ck.version(), "c:", ck.libversion()' |
| 106 | + py: ('0.11.4', 721920) c: ('0.11.4-RC1', 722121) |
| 107 | + |
| 108 | + |
| 109 | +## 7. Upload packages to PyPi |
| 110 | + |
| 111 | +To upload packages to test.pypi.org, use: |
| 112 | + |
| 113 | + $ twine upload -r test dl-v0.11.4rc1/* |
| 114 | + |
| 115 | +To upload packages to the proper pypi.org (WARNING!), use: |
| 116 | + |
| 117 | + $ twine upload dl-v0.11.4rc1/* |
| 118 | + |
| 119 | + |
| 120 | +## 8. Verify installation from PyPi |
| 121 | + |
| 122 | +In the same virtualenv as created above: |
| 123 | + |
| 124 | + $ pip uninstall confluent_kafka |
| 125 | + |
| 126 | + # For release-candidates specify --pre argument and version-pinning: |
| 127 | + |
| 128 | + $ pip install --pre confluent_kafka==0.11.4rc1 |
| 129 | + |
| 130 | + |
| 131 | + # For final releases no --pre or version-pinning, pay |
| 132 | + # attention to the version being picked up, should be the |
| 133 | + # final v0.11.4 release: |
| 134 | + |
| 135 | + $ pip install confluent_kafka |
| 136 | + |
| 137 | + |
| 138 | +Verify that the package works and prints the expected version: |
| 139 | + $ python -c 'import confluent_kafka as ck ; print "py:", ck.version(), "c:", ck.libversion()' |
| 140 | + py: ('0.11.4', 721920) c: ('0.11.4-RC1', 722121) |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | +## 9. Create github release |
| 145 | + |
| 146 | +If this was the final release, go to |
| 147 | +[github releases](https://github.com/confluentinc/confluent-kafka-python/releases) |
| 148 | +and create a new release with the same name as the final release tag (`v0.11.4`). |
| 149 | + |
| 150 | +Add three sections (with markdown `# New features`) to the description: |
| 151 | + * New features |
| 152 | + * Enhancements |
| 153 | + * Fixes |
| 154 | + |
| 155 | +Print the git commit log and copy-paste relevant commits to |
| 156 | +the release description, reformatting them as necessary to look nice in |
| 157 | +the changelog, put the commits in the appropriate section. |
| 158 | + |
| 159 | + $ git log --oneline v0.11.3..v0.11.4 |
| 160 | + |
| 161 | +Create the release. |
| 162 | + |
| 163 | + |
| 164 | +That's it, back to the coal mine. |
0 commit comments