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

Automated the release process #201

Merged

Conversation

jpkrohling
Copy link
Collaborator

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.

@jpkrohling jpkrohling changed the title Automated the release process [wip] Automated the release process Jun 23, 2017
@jpkrohling jpkrohling force-pushed the JPK-AutomateReleaseProcess branch 2 times, most recently from e8fa91c to 574ba62 Compare June 23, 2017 04:33
@jpkrohling jpkrohling force-pushed the JPK-AutomateReleaseProcess branch 2 times, most recently from 8ed8dee to 5a741e2 Compare June 23, 2017 06:40
@codecov-io
Copy link

codecov-io commented Jun 23, 2017

Codecov Report

Merging #201 into master will decrease coverage by 0.16%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #201      +/-   ##
============================================
- Coverage     80.59%   80.43%   -0.17%     
+ Complexity      478      476       -2     
============================================
  Files            79       79              
  Lines          1855     1855              
  Branches        218      218              
============================================
- Hits           1495     1492       -3     
- Misses          272      273       +1     
- Partials         88       90       +2
Impacted Files Coverage Δ Complexity Δ
...jaeger/reporters/protocols/ThriftUdpTransport.java 77.96% <0%> (-5.09%) 14% <0%> (-2%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df066d3...be9adbc. Read the comment docs.

@jpkrohling jpkrohling force-pushed the JPK-AutomateReleaseProcess branch 5 times, most recently from 71a9c55 to 3ca1c73 Compare June 23, 2017 07:32
@pavolloffay
Copy link
Member

Could you please describe the process in RELEASE.md?

@jpkrohling jpkrohling force-pushed the JPK-AutomateReleaseProcess branch from 3ca1c73 to d6b9191 Compare June 23, 2017 07:43
@jpkrohling
Copy link
Collaborator Author

RELEASE.md updated

@jpkrohling jpkrohling force-pushed the JPK-AutomateReleaseProcess branch from d6b9191 to 549db73 Compare June 23, 2017 07:45
build.gradle Outdated
@@ -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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also check the tag on regex.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somebody could accidentally push i-had-a-hard-time-yesterday-1.0 :/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the current state, this is not a problem. Either this will fail during the upload phase, or we could just not close/release the staging repo at Nexus.

@jpkrohling jpkrohling changed the title [wip] Automated the release process Automated the release process Jun 23, 2017
.travis.yml Outdated
- 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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these all should be skipped when not "$TRAVIS_SECURE_ENV_VARS

RELEASE.md Outdated
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in zipkin release scripts the manual tag has a format release-M.N.P, and the script creates another tag (I think). If here the manual tag is the only one, it should have the v prefix, a common convention for semver.

And as @pavolloffay said, I think the build should match on the vM.N.P pattern when publishing a release, instead of any tag.

@jpkrohling jpkrohling force-pushed the JPK-AutomateReleaseProcess branch from 549db73 to 2559048 Compare June 26, 2017 13:08
@jpkrohling
Copy link
Collaborator Author

I implemented two changes based on the comments:

  1. The logic to determine the version is now on a def of its own, matching the regex [v]?((\d+)\.(\d+)\.(\d+)). Note that the very first part makes the v optional. Should it be required? When the value for the tag is not a match for this regex, the -SNAPSHOT version is used.
  2. Instead of having several before_install commands, I created a new script (prepare-signing.sh) that would make it easier to maintain and debug.

I need the following from @yurishkuro :

  • a real signing-key.asc.enc, with the encrypted private key that will be used to sign the artifacts. Ideally, this would be a "project" key, based on an email that is clear that comes from this project. Something like, build@jaegertracing.io.
  • encrypted values for SIGNING_KEY_ID and SIGNING_KEY_PASSPHRASE. In fact, the KEY_ID does not need to be secure, but I'll need to know what it is, to add to the Travis configuration file
travis encrypt-file travis/signing-key.asc -r uber/jaeger-client-java
travis encrypt SIGNING_KEY_ID=5557EADD
travis encrypt SIGNING_KEY_PASSPHRASE=...

@jpkrohling jpkrohling force-pushed the JPK-AutomateReleaseProcess branch 2 times, most recently from e95eb51 to 339a768 Compare June 26, 2017 13:29
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.
@jpkrohling jpkrohling force-pushed the JPK-AutomateReleaseProcess branch from 339a768 to b1bce5a Compare June 26, 2017 13:31
@yurishkuro
Copy link
Member

added in #205

RELEASE.md Outdated
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to keep this section, in case we need to re-generate the key.

@jpkrohling jpkrohling mentioned this pull request Jun 28, 2017
@jpkrohling
Copy link
Collaborator Author

Once this is OK, I'll squash the commits and update the PR. I'll also try to release v0.20.1 (and possibly other v0.20.x) to test the procedure.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants