Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Automated the release process
Browse files Browse the repository at this point in the history
This PR automates the release process, by setting the version to -SNAPSHOT
when on a regular build, but to a proper fixed version when building for a tag.

This effectively means that releasing is just a matter of tagging the code at
a given point.

It's still needed to manually bump the version after a tag.

At this stage, closing/releasing of the Nexus repository is still manual and
will be automated if the main release procedure proves stable enough.
  • Loading branch information
jpkrohling committed Jun 23, 2017
1 parent 1d97158 commit 549db73
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 54 deletions.
33 changes: 17 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
sudo: required

language: java

dist: trusty

matrix:
include:
- env:
- TESTS=true
- COVERAGE=true
- env:
- CROSSDOCK=true

services:
- docker

env:
global:
- DOCKER_VERSION=1.11.1-0~trusty
- DOCKER_COMPOSE_VERSION=1.7.0
- COMMIT=${TRAVIS_COMMIT::8}
# SONATYPE_USERNAME=<sonatype username>
- secure: PRiEM4oGX4yjIzQlGMg+C28LdrkikUO8fsCXul0O+mJQ6Yua3b+G9HOC586UvyqAY4mFvSGP/EIefBuRLVQhFKvHpxHtfjpGg3w2Txq9KxiY5DjaYFuihKPz8Zs+PAZXd8rWqQvjZFkpHHmXdQG5I4MRSCb5Pkk/T3uwJqDCpcQeaBxWIglwVm4etM4pBxQT7BCVKvh4CJ6vNJuLPRRqn4CqgnZV9ytcrUoOF3binbdP2S2KImBqimAyLW3ThqTaJ2xkGWTKI7oc3k2NCejIFUPcf9dzzZ4aKKu9x9t94v7QSwLOE+9tQh5F0W3C89qcG9SmPVaTS7QwQhKwFP92BfMbobu056VSxSFielQ5DvPTaAiStGBzr/2Uhn+KITjSRNj6dX6tjaL9q/8TFE+g0QZIP00PhfzzNOde5Nlh8fUu3bo+4X6Y+WPXHEe8SfLdVYIb6+1zvxkNyWHQoeN+uDGIDSOgWYT74tz0HBcpt2WIrOPaSc6m6RaZKC8dOuWODY+HRZXetwvs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J9QboiUjpcOlN1bhRJ1oi6OrgacH4do+yhWJyar2f+djomWDJ6uvsKqep3T+CjB945EFA=
# SIGNING_KEY_PASSPHRASE
- secure: T5pS+mGSBMntcRvwYU1YZoCiJbBgyPzl67UKa2ivyFeRxd7s+v4UZgdCKxCtvj6HlHjePf0gKBEPq/QrDMNwculzRQ2yuMxS6FVm/MUCcjt8sAnxMsPYLJpHNXTHwPSzHWEQ+iC8GeoZQ17C+SJtYj+wruXSlh/NeL9Ni5dzD3NcpA/WCi7kiWUWlIjKVkseZdHWOS+jBcvbLq9NxzLlES26KzPgB7Pk5PARAKjhbzEr5BDNgOk8K1sX1OskiFlFM5W9QX+cW2kfG9aMm5FfAfA1UjwEWhWYq2R7nTC/MuYhNLwgGV25h2rj6l52ys9B9VpdmXCawXRBmZrTYxHKAc30nNvEtr+4lh4b3ywIh6gm1D0Jvh+LLVeOKDaTPxN3SrmtUN/ORp+4oaF7/qzTqOXCpUO7zdNHl7PKAaCgOKwmedWFZyeDuOeEStGWp/2/RTjEdzozfdiMRrtI3q61uslYyNLMTdQ97cb7FtBlmsljkkgFWMZg2/k5VdWNuaTWGCrpo53IaAauRQBtVmM6KNgL3J97qkKUQr3gDW7ADd0Zy5cStPtybSuk50Rc6rb1cTA0BzkQPWAVGzy4mVeG00m6OuR2Gje0ceidydW0ELoV368e10RJPSlXyZ89aLNbGVk1l64c6/YR/D1dYK7bLc3I/j5e3pnWbkMKI5wsMxc=
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
before_install:
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ]; then openssl aes-256-cbc -K $encrypted_677f232983c0_key -iv $encrypted_677f232983c0_iv -in travis/signing-key.asc.enc -out travis/signing-key.asc -d ; fi
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ]; then gpg --no-tty --batch --allow-secret-key-import --import travis/signing-key.asc ; fi
- rm -rf "$HOME/.gradle/gradle.properties"
- echo signing.keyId="${SIGNING_KEY_ID}" > "$HOME/.gradle/gradle.properties"
- echo signing.password="${SIGNING_KEY_PASSPHRASE}" >> "$HOME/.gradle/gradle.properties"
- echo ossrhUsername="${SONATYPE_USERNAME}" >> "$HOME/.gradle/gradle.properties"
- echo ossrhPassword="${SONATYPE_PASSWORD}" >> "$HOME/.gradle/gradle.properties"
- echo signing.secretKeyRingFile="${HOME}/.gnupg/secring.gpg" >> "$HOME/.gradle/gradle.properties"
- if [ "$CROSSDOCK" == true ]; then bash ./travis/install-crossdock-deps.sh ; fi
- sudo rm -rf /usr/local/bin/thrift
- sudo cp travis/docker-thrift/thrift /usr/local/bin/


script:
- if [ "$TESTS" == true ]; then make test ; else echo 'skipping tests'; fi
- if [ "$COVERAGE" == true ]; then ./gradlew codeCoverageReport ; else echo 'skipping coverage'; fi
- if [ "$CROSSDOCK" == true ]; then bash ./travis/build-crossdock.sh ; else echo 'skipping crossdock'; fi

after_success:
- if [ "$COVERAGE" == true ]; then bash <(curl -s https://codecov.io/bash) ; fi
- if [ "$CROSSDOCK" == true ]; then ./gradlew uploadArchives -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" ; fi
- if [ "$CROSSDOCK" == true -a "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == false ]; then ./gradlew upload ; fi
45 changes: 8 additions & 37 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,16 @@
# Release Process

TODO: the release process is too manual and needs to be automated

The release process consists of these steps:
1. Edit build.gradle and remove the `-SNAPSHOT` suffix from the `version` parameter
1. Add an entry to CHANGELOG.pm with description of changes in the new release
1. Commit as "Preparing release"
1. Run `make release`
* Make sure you have the right version 0.9.2 of Thrift installed: `thrift -version`
1. Once the artifacts are uploaded to Sonatype staging, release them to Maven Central
1. Add an entry to [`CHANGELOG.md`](CHANGELOG.rst) with description of changes in the new release
1. Commit your `CHANGELOG` changes
1. Tag as a version (`git tag 0.20.0`). Use the one from [`build.gradle`](build.gradle) as reference.
1. Push the tag (`git push 0.20.0`)
1. Once the *tag* build finishes in Travis, the artifacts should have been uploaded to Sonatype staging.
At this stage, you'll need to close and release the staging repository. After that, the artifacts should
soon reach Maven Central.
* https://oss.sonatype.org/, log in, go to Staging Repositories
* In the top-right corner search box type `uber`, and find your uploaded repository
* Hit Close button. Monitor status on Activity tab at the bottom, hitting Refresh.
* Once Close is successful, the Release button will become available, so hit it
* Keep hitting Refresh while sync to Maven is in progress. Once it's complete, the repository will disappear.
1. Bump the version in `build.gradle` to the next release and add `-SNAPSHOT suffix
1. Commit as "Back to development"

The `uploadArchives` step performs signing of the artifacts. For that to work the script
requires private/public keys.

* install GPG: `brew install gpg`
* generate keys: `gpg --gen-key`
* see installed keys with `gpg --list-keys` or `gpg --list-secret-keys`
* create an account with Sonatype, get repo permissions (e.g. https://issues.sonatype.org/browse/OSSRH-23572)
* create `$HOME/.gradle/gradle.properties` file
```
signing.keyId={key ID from gpg --list-secret-keys}
signing.password={password you used to encrypt keys via gpg --gen-key}
signing.secretKeyRingFile={e.g. [home path]/.gnupg/secring.gpg}
ossrhUsername={your user name at Sonatype}
ossrhPassword={your password at Sonatype}
```
* upload your public key to Ubuntu servers, e.g.
* `gpg --keyserver http://keyserver.ubuntu.com:11371 --send-keys {pub key ID}`
* you can also use Web UI and upload plain test key that you can obtain via
* `gpg --armor --export {your email used for the keys}`


[ci-img]: https://travis-ci.org/uber/jaeger-client-java.svg?branch=master
[cov-img]: https://codecov.io/github/uber/jaeger-client-java/coverage.png?branch=master
[ci]: https://travis-ci.org/uber/jaeger-client-java
[cov]: https://codecov.io/github/uber/jaeger-client-java/
1. Bump the version in `build.gradle` to the next release and commit it
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ allprojects {
apply plugin: 'jacoco'

group = 'com.uber.jaeger'
version = '0.20.0-SNAPSHOT'
version = System.env.TRAVIS_TAG ? System.env.TRAVIS_TAG : '0.20.0-SNAPSHOT'

repositories {
mavenCentral()
Expand Down Expand Up @@ -142,6 +142,12 @@ task codeCoverageReport(type: JacocoReport, group: 'Coverage reports') {
}
}

task printVersion {
doLast {
println project.version
}
}

configure(subprojects.findAll {it.name != 'jaeger-thrift'}) {
apply plugin: 'net.ltgt.errorprone'
dependencies {
Expand Down
Binary file added travis/signing-key.asc.enc
Binary file not shown.

0 comments on commit 549db73

Please sign in to comment.