|
| 1 | +## Tag Driven Releasing |
| 2 | + |
| 3 | +### Initial setup for the repository |
| 4 | + |
| 5 | +To configure tag driven releases from Travis CI. |
| 6 | + |
| 7 | + 1. Generate a key pair for this repository with `./admin/genKeyPair.sh`. |
| 8 | + Edit `.travis.yml` and `admin/build.sh` as prompted. |
| 9 | + 1. Publish the public key to https://pgp.mit.edu |
| 10 | + 1. Store other secrets as encrypted environment variables with `./admin/encryptEnvVars.sh`. |
| 11 | + Edit `.travis.yml` as prompted. |
| 12 | + 1. Edit `.travis.yml` to use `./admin/build.sh` as the build script, |
| 13 | + and edit that script to use the tasks required for this project. |
| 14 | + Ensure that `RELEASE_COMBO` is `true` for build matrix combinations |
| 15 | + that should be released to sonatype (when building a tag). |
| 16 | + |
| 17 | +It is important to add comments in `.travis.yml` to identify the name |
| 18 | +of each environment variable encoded in a `secure` section. |
| 19 | + |
| 20 | +After these steps, your `.travis.yml` should contain config of the form: |
| 21 | + |
| 22 | +``` |
| 23 | +language: scala |
| 24 | +
|
| 25 | +jdk: |
| 26 | + - openjdk8 |
| 27 | +
|
| 28 | +scala: |
| 29 | + - 2.11.12 |
| 30 | + - 2.12.6 |
| 31 | +
|
| 32 | +env: |
| 33 | + global: |
| 34 | + # PGP_PASSPHRASE |
| 35 | + - secure: "XXXXXX" |
| 36 | + # SONA_USER |
| 37 | + - secure: "XXXXXX" |
| 38 | + # SONA_PASS |
| 39 | + - secure: "XXXXXX" |
| 40 | +
|
| 41 | +script: admin/build.sh |
| 42 | +
|
| 43 | +notifications: |
| 44 | + email: |
| 45 | + |
| 46 | +``` |
| 47 | + |
| 48 | +If Sonatype credentials change in the future, step 3 can be repeated |
| 49 | +without generating a new key. |
| 50 | + |
| 51 | +### Testing |
| 52 | + |
| 53 | + 1. Follow the release process below to create a dummy release (e.g., `v0.1.0-TEST1`). |
| 54 | + Confirm that the release was staged to Sonatype but do not release it to Maven |
| 55 | + central. Instead, drop the staging repository. |
| 56 | + |
| 57 | +### Performing a release |
| 58 | + |
| 59 | + 1. Create a GitHub "Release" with a corresponding tag (e.g., `v0.1.1`) via the GitHub |
| 60 | + web interface. |
| 61 | + 1. The release will be published using the Scala and JVM version combinations specified |
| 62 | + in the travis build matrix where `[ "$RELEASE_COMBO" = "true" ]`. |
| 63 | + - If you need to release against a different Scala version, create a new commit that modifies |
| 64 | + `.travis.yml` and push a new tag, e.g., `v1.2.3#2.13.0-M5`. The suffix after `#` is ignored. |
| 65 | + 1. Travis CI will schedule a build for this release. Review the build logs. |
| 66 | + 1. Log into https://oss.sonatype.org/ and identify the staging repository. |
| 67 | + 1. Sanity check its contents. |
| 68 | + 1. Release staging repository to Maven and send out release announcement. |
0 commit comments