1*cd0cc2e3SAndroid Build Coastguard WorkerHow to Create a Conscrypt Release 2*cd0cc2e3SAndroid Build Coastguard Worker==================================== 3*cd0cc2e3SAndroid Build Coastguard Worker 4*cd0cc2e3SAndroid Build Coastguard WorkerOne-Time Setup 5*cd0cc2e3SAndroid Build Coastguard Worker-------------- 6*cd0cc2e3SAndroid Build Coastguard Worker 7*cd0cc2e3SAndroid Build Coastguard WorkerThese steps need to be performed once by each person doing releases. 8*cd0cc2e3SAndroid Build Coastguard Worker 9*cd0cc2e3SAndroid Build Coastguard Worker### Platforms 10*cd0cc2e3SAndroid Build Coastguard Worker 11*cd0cc2e3SAndroid Build Coastguard WorkerConscrypt is built on Linux, Mac, and Windows, so ensure you have access to machines 12*cd0cc2e3SAndroid Build Coastguard Workerrunning all three. The 1.0.0 release was made with the following configuration: 13*cd0cc2e3SAndroid Build Coastguard Worker 14*cd0cc2e3SAndroid Build Coastguard Worker* Ubuntu 14.04 15*cd0cc2e3SAndroid Build Coastguard Worker* MacOS Sierra (10.12) 16*cd0cc2e3SAndroid Build Coastguard Worker* Windows Server 2016 17*cd0cc2e3SAndroid Build Coastguard Worker 18*cd0cc2e3SAndroid Build Coastguard Worker### Software 19*cd0cc2e3SAndroid Build Coastguard Worker 20*cd0cc2e3SAndroid Build Coastguard WorkerThe following software is necessary and may not be installed by default: 21*cd0cc2e3SAndroid Build Coastguard Worker 22*cd0cc2e3SAndroid Build Coastguard Worker<!-- TODO(flooey): Expand and link these, there's probably more --> 23*cd0cc2e3SAndroid Build Coastguard Worker* Linux: [Docker](https://www.docker.com/), [Android SDK](https://developer.android.com/studio/index.html) 24*cd0cc2e3SAndroid Build Coastguard Worker* MacOS: Java SDK 25*cd0cc2e3SAndroid Build Coastguard Worker* Windows: MSVC, git, NASM, Java 26*cd0cc2e3SAndroid Build Coastguard Worker 27*cd0cc2e3SAndroid Build Coastguard Worker### Setup OSSRH and GPG 28*cd0cc2e3SAndroid Build Coastguard Worker 29*cd0cc2e3SAndroid Build Coastguard WorkerIf you haven't deployed artifacts to Maven Central before, you need to setup 30*cd0cc2e3SAndroid Build Coastguard Workeryour OSSRH (OSS Repository Hosting) account and signing keys. 31*cd0cc2e3SAndroid Build Coastguard Worker- Follow the instructions on [this 32*cd0cc2e3SAndroid Build Coastguard Worker page](http://central.sonatype.org/pages/ossrh-guide.html) to set up an 33*cd0cc2e3SAndroid Build Coastguard Worker account with OSSRH. 34*cd0cc2e3SAndroid Build Coastguard Worker - You only need to create the account, not set up a new project 35*cd0cc2e3SAndroid Build Coastguard Worker - Contact a Conscrypt maintainer to add your account after you have created it. 36*cd0cc2e3SAndroid Build Coastguard Worker- Install GnuPG and [generate your key 37*cd0cc2e3SAndroid Build Coastguard Worker pair](https://www.gnupg.org/documentation/howtos.html). 38*cd0cc2e3SAndroid Build Coastguard Worker- [Publish your public key](https://www.gnupg.org/gph/en/manual.html#AEN464) 39*cd0cc2e3SAndroid Build Coastguard Worker to make it visible to the Sonatype servers 40*cd0cc2e3SAndroid Build Coastguard Worker (e.g. `gpg --keyserver pgp.mit.edu --send-key <key ID>`). 41*cd0cc2e3SAndroid Build Coastguard Worker 42*cd0cc2e3SAndroid Build Coastguard Worker### Get the signing certificates 43*cd0cc2e3SAndroid Build Coastguard Worker 44*cd0cc2e3SAndroid Build Coastguard WorkerContact an existing Conscrypt maintainer to get the keystore containing the 45*cd0cc2e3SAndroid Build Coastguard Workercode signing certificate. 46*cd0cc2e3SAndroid Build Coastguard Worker 47*cd0cc2e3SAndroid Build Coastguard Worker### Set up gradle.properties 48*cd0cc2e3SAndroid Build Coastguard Worker 49*cd0cc2e3SAndroid Build Coastguard WorkerAdd your OSSRH credentials, GPG key information, and the code signing keystore details 50*cd0cc2e3SAndroid Build Coastguard Workerto `$HOME/.gradle/gradle.properties`. 51*cd0cc2e3SAndroid Build Coastguard Worker 52*cd0cc2e3SAndroid Build Coastguard Worker``` 53*cd0cc2e3SAndroid Build Coastguard Workersigning.keyId=<8-character-public-key-id> 54*cd0cc2e3SAndroid Build Coastguard Workersigning.password=<key-password> 55*cd0cc2e3SAndroid Build Coastguard Workersigning.secretKeyRingFile=<your-home-directory>/.gnupg/secring.gpg 56*cd0cc2e3SAndroid Build Coastguard Worker 57*cd0cc2e3SAndroid Build Coastguard WorkersigningKeystore=<path-to-keystore> 58*cd0cc2e3SAndroid Build Coastguard WorkersigningPassword=<keystore-password> 59*cd0cc2e3SAndroid Build Coastguard Worker 60*cd0cc2e3SAndroid Build Coastguard WorkerossrhUsername=<ossrh-username> 61*cd0cc2e3SAndroid Build Coastguard WorkerossrhPassword=<ossrh-password> 62*cd0cc2e3SAndroid Build Coastguard Workercheckstyle.ignoreFailures=false 63*cd0cc2e3SAndroid Build Coastguard Worker``` 64*cd0cc2e3SAndroid Build Coastguard Worker 65*cd0cc2e3SAndroid Build Coastguard WorkerOnce Per Release Series Setup 66*cd0cc2e3SAndroid Build Coastguard Worker----------------------------- 67*cd0cc2e3SAndroid Build Coastguard Worker 68*cd0cc2e3SAndroid Build Coastguard WorkerThese steps need to be performed once per `X.Y` release series. 69*cd0cc2e3SAndroid Build Coastguard Worker 70*cd0cc2e3SAndroid Build Coastguard Worker### Create the release branch 71*cd0cc2e3SAndroid Build Coastguard Worker 72*cd0cc2e3SAndroid Build Coastguard WorkerWe use a branch named `<major>.<minor>.x` for all releases in a series. 73*cd0cc2e3SAndroid Build Coastguard Worker 74*cd0cc2e3SAndroid Build Coastguard WorkerCreate the branch and push it to GitHub: 75*cd0cc2e3SAndroid Build Coastguard Worker 76*cd0cc2e3SAndroid Build Coastguard Worker```bash 77*cd0cc2e3SAndroid Build Coastguard Worker$ git checkout -b 1.0.x master 78*cd0cc2e3SAndroid Build Coastguard Worker$ git push upstream 1.0.x 79*cd0cc2e3SAndroid Build Coastguard Worker``` 80*cd0cc2e3SAndroid Build Coastguard Worker 81*cd0cc2e3SAndroid Build Coastguard Worker### Set the branch protection settings 82*cd0cc2e3SAndroid Build Coastguard Worker 83*cd0cc2e3SAndroid Build Coastguard WorkerIn the GitHub UI, go to Settings -> Branches and mark the new branch as 84*cd0cc2e3SAndroid Build Coastguard Workerprotected, with administrators included and restrict pushes to administrators. 85*cd0cc2e3SAndroid Build Coastguard Worker 86*cd0cc2e3SAndroid Build Coastguard Worker### Update the master version 87*cd0cc2e3SAndroid Build Coastguard Worker 88*cd0cc2e3SAndroid Build Coastguard WorkerUpdate the master branch's version to the next minor snapshot. 89*cd0cc2e3SAndroid Build Coastguard Worker 90*cd0cc2e3SAndroid Build Coastguard Worker```bash 91*cd0cc2e3SAndroid Build Coastguard Worker$ git checkout -b bump-version master 92*cd0cc2e3SAndroid Build Coastguard Worker# Change version in build.gradle to X.Y+1-SNAPSHOT 93*cd0cc2e3SAndroid Build Coastguard Worker$ git commit -a -m 'Start X.Y+1 development cycle' 94*cd0cc2e3SAndroid Build Coastguard Worker# Push to GitHub and get reviewed like normal 95*cd0cc2e3SAndroid Build Coastguard Worker``` 96*cd0cc2e3SAndroid Build Coastguard Worker 97*cd0cc2e3SAndroid Build Coastguard WorkerMaking a New Release 98*cd0cc2e3SAndroid Build Coastguard Worker-------------------- 99*cd0cc2e3SAndroid Build Coastguard Worker 100*cd0cc2e3SAndroid Build Coastguard Worker### Cherry-pick changes from the master branch (optional) 101*cd0cc2e3SAndroid Build Coastguard Worker 102*cd0cc2e3SAndroid Build Coastguard WorkerCherry-pick any desired master changes since the branch was created. 103*cd0cc2e3SAndroid Build Coastguard Worker 104*cd0cc2e3SAndroid Build Coastguard Worker```bash 105*cd0cc2e3SAndroid Build Coastguard Worker$ git checkout 1.0.x 106*cd0cc2e3SAndroid Build Coastguard Worker$ git cherry-pick <revision> 107*cd0cc2e3SAndroid Build Coastguard Worker``` 108*cd0cc2e3SAndroid Build Coastguard Worker 109*cd0cc2e3SAndroid Build Coastguard Worker### Tag the release 110*cd0cc2e3SAndroid Build Coastguard Worker 111*cd0cc2e3SAndroid Build Coastguard Worker```bash 112*cd0cc2e3SAndroid Build Coastguard Worker# Change version in build.gradle to this version's number 113*cd0cc2e3SAndroid Build Coastguard Worker$ git commit -a -m 'Preparing version 1.0.0' 114*cd0cc2e3SAndroid Build Coastguard Worker$ git tag -a 1.0.0 -m 'Version 1.0.0' 115*cd0cc2e3SAndroid Build Coastguard Worker``` 116*cd0cc2e3SAndroid Build Coastguard Worker 117*cd0cc2e3SAndroid Build Coastguard Worker### Push to GitHub 118*cd0cc2e3SAndroid Build Coastguard Worker 119*cd0cc2e3SAndroid Build Coastguard WorkerPush both the branch and the new tag to GitHub. 120*cd0cc2e3SAndroid Build Coastguard Worker 121*cd0cc2e3SAndroid Build Coastguard Worker```bash 122*cd0cc2e3SAndroid Build Coastguard Worker$ git push upstream 1.0.x 123*cd0cc2e3SAndroid Build Coastguard Worker$ git push upstream 1.0.0 124*cd0cc2e3SAndroid Build Coastguard Worker``` 125*cd0cc2e3SAndroid Build Coastguard Worker 126*cd0cc2e3SAndroid Build Coastguard Worker### Build the Linux OpenJDK Release 127*cd0cc2e3SAndroid Build Coastguard Worker 128*cd0cc2e3SAndroid Build Coastguard WorkerThe deployment for Linux uses [Docker](https://www.docker.com/) running 129*cd0cc2e3SAndroid Build Coastguard WorkerCentOS 6.6 in order to ensure that we have a consistent deployment environment 130*cd0cc2e3SAndroid Build Coastguard Workeron Linux. 131*cd0cc2e3SAndroid Build Coastguard Worker 132*cd0cc2e3SAndroid Build Coastguard Worker1. From the conscrypt source directory: 133*cd0cc2e3SAndroid Build Coastguard Worker 134*cd0cc2e3SAndroid Build Coastguard Worker ```bash 135*cd0cc2e3SAndroid Build Coastguard Worker $ docker build -t conscrypt-deploy release 136*cd0cc2e3SAndroid Build Coastguard Worker ``` 137*cd0cc2e3SAndroid Build Coastguard Worker1. Start a Docker container that has the deploy environment set up for you. The 138*cd0cc2e3SAndroid Build Coastguard Worker Conscrypt source is cloned into `/conscrypt`. 139*cd0cc2e3SAndroid Build Coastguard Worker 140*cd0cc2e3SAndroid Build Coastguard Worker ```bash 141*cd0cc2e3SAndroid Build Coastguard Worker $ docker run -it --rm=true conscrypt-deploy 142*cd0cc2e3SAndroid Build Coastguard Worker ``` 143*cd0cc2e3SAndroid Build Coastguard Worker 144*cd0cc2e3SAndroid Build Coastguard Worker Note that the container will be deleted after you exit. Any changes you have 145*cd0cc2e3SAndroid Build Coastguard Worker made (e.g., copied configuration files) will be lost. If you want to keep the 146*cd0cc2e3SAndroid Build Coastguard Worker container, remove `--rm=true` from the command line. 147*cd0cc2e3SAndroid Build Coastguard Worker1. Copy your OSSRH credentials and GnuPG keys to your docker container. In Docker: 148*cd0cc2e3SAndroid Build Coastguard Worker ``` 149*cd0cc2e3SAndroid Build Coastguard Worker # mkdir /root/.gradle 150*cd0cc2e3SAndroid Build Coastguard Worker ``` 151*cd0cc2e3SAndroid Build Coastguard Worker Find the container ID in your bash prompt, which is shown as `[root@<container-ID> ...]`. 152*cd0cc2e3SAndroid Build Coastguard Worker In host: 153*cd0cc2e3SAndroid Build Coastguard Worker ``` 154*cd0cc2e3SAndroid Build Coastguard Worker $ docker cp ~/.gnupg <container-ID>:/root/ 155*cd0cc2e3SAndroid Build Coastguard Worker $ docker cp ~/.gradle/gradle.properties <container-ID>:/root/.gradle/ 156*cd0cc2e3SAndroid Build Coastguard Worker $ docker cp <path to cert keystore> <container-ID>:/root/certkeystore 157*cd0cc2e3SAndroid Build Coastguard Worker ``` 158*cd0cc2e3SAndroid Build Coastguard Worker 159*cd0cc2e3SAndroid Build Coastguard Worker You'll also need to update `signing.secretKeyRingFile` and `signingKeystore` in 160*cd0cc2e3SAndroid Build Coastguard Worker `/root/.gradle/gradle.properties` to point to `/root/.gnupg/secring.gpg` and 161*cd0cc2e3SAndroid Build Coastguard Worker `/root/certkeystore`, respectively. 162*cd0cc2e3SAndroid Build Coastguard Worker1. Create the initial build 163*cd0cc2e3SAndroid Build Coastguard Worker ```bash 164*cd0cc2e3SAndroid Build Coastguard Worker $ git checkout 1.0.x 165*cd0cc2e3SAndroid Build Coastguard Worker $ ./gradlew conscrypt-openjdk:build 166*cd0cc2e3SAndroid Build Coastguard Worker $ ./gradlew -Dorg.gradle.parallel=false publish 167*cd0cc2e3SAndroid Build Coastguard Worker ``` 168*cd0cc2e3SAndroid Build Coastguard Worker1. Note the BoringSSL commit used for this build. 169*cd0cc2e3SAndroid Build Coastguard Worker ```bash 170*cd0cc2e3SAndroid Build Coastguard Worker $ cd /usr/src/boringssl 171*cd0cc2e3SAndroid Build Coastguard Worker $ git log -n 1 172*cd0cc2e3SAndroid Build Coastguard Worker ``` 173*cd0cc2e3SAndroid Build Coastguard Worker1. Go to the OSSRH UI and note the ID of the new staging repository. It should be in the 174*cd0cc2e3SAndroid Build Coastguard Worker form of `orgconscrypt-NNNN`. 175*cd0cc2e3SAndroid Build Coastguard Worker 176*cd0cc2e3SAndroid Build Coastguard Worker### Build the Windows OpenJDK Release 177*cd0cc2e3SAndroid Build Coastguard Worker 178*cd0cc2e3SAndroid Build Coastguard WorkerSee [BUILDING](../BUILDING.md) for instructions for setting up the build environment. 179*cd0cc2e3SAndroid Build Coastguard Worker 180*cd0cc2e3SAndroid Build Coastguard Worker1. Ensure BoringSSL is synced to the same revision as for the Linux build. 181*cd0cc2e3SAndroid Build Coastguard Worker ```bash 182*cd0cc2e3SAndroid Build Coastguard Worker $ git checkout <revision> 183*cd0cc2e3SAndroid Build Coastguard Worker $ cd build64 184*cd0cc2e3SAndroid Build Coastguard Worker $ ninja 185*cd0cc2e3SAndroid Build Coastguard Worker ``` 186*cd0cc2e3SAndroid Build Coastguard Worker1. Build the code and upload it to the staging repository noted previously. 187*cd0cc2e3SAndroid Build Coastguard Worker ```bash 188*cd0cc2e3SAndroid Build Coastguard Worker $ gradlew conscrypt-openjdk:build 189*cd0cc2e3SAndroid Build Coastguard Worker $ gradlew conscrypt-openjdk:publish -Dorg.gradle.parallel=false -PrepositoryId=<repository-id> 190*cd0cc2e3SAndroid Build Coastguard Worker ``` 191*cd0cc2e3SAndroid Build Coastguard Worker 192*cd0cc2e3SAndroid Build Coastguard Worker### Build the Mac and Windows OpenJDK Releases 193*cd0cc2e3SAndroid Build Coastguard Worker 194*cd0cc2e3SAndroid Build Coastguard WorkerSee [BUILDING](../BUILDING.md) for instructions for setting up the build environment. 195*cd0cc2e3SAndroid Build Coastguard Worker 196*cd0cc2e3SAndroid Build Coastguard Worker1. Ensure BoringSSL is synced to the same revision as for the Linux build. 197*cd0cc2e3SAndroid Build Coastguard Worker ```bash 198*cd0cc2e3SAndroid Build Coastguard Worker $ git checkout <revision> 199*cd0cc2e3SAndroid Build Coastguard Worker $ cd build.x86 200*cd0cc2e3SAndroid Build Coastguard Worker $ ninja 201*cd0cc2e3SAndroid Build Coastguard Worker $ cd ../build.arm 202*cd0cc2e3SAndroid Build Coastguard Worker $ ninja 203*cd0cc2e3SAndroid Build Coastguard Worker ``` 204*cd0cc2e3SAndroid Build Coastguard Worker1. Build the code and upload it to the staging repository noted previously. 205*cd0cc2e3SAndroid Build Coastguard Worker ```bash 206*cd0cc2e3SAndroid Build Coastguard Worker $ ./gradlew conscrypt-openjdk:build 207*cd0cc2e3SAndroid Build Coastguard Worker $ ./gradlew conscrypt-openjdk:publish -Dorg.gradle.parallel=false -PrepositoryId=<repository-id> 208*cd0cc2e3SAndroid Build Coastguard Worker ``` 209*cd0cc2e3SAndroid Build Coastguard Worker 210*cd0cc2e3SAndroid Build Coastguard Worker### Close and Release the Staging Repository 211*cd0cc2e3SAndroid Build Coastguard Worker 212*cd0cc2e3SAndroid Build Coastguard Worker1. Navigate to the staging repository, open the contents, and ensure there are jars for 213*cd0cc2e3SAndroid Build Coastguard Worker each supported build environment: linux-x86_64, osx-x86_64, windows-x86, and windows-x86_64. 214*cd0cc2e3SAndroid Build Coastguard Worker1. Click the `close` button at the top of the staging repo list. 215*cd0cc2e3SAndroid Build Coastguard Worker1. After the automated checks are done, click the `release` button at the top of the staging repo list. 216*cd0cc2e3SAndroid Build Coastguard Worker 217*cd0cc2e3SAndroid Build Coastguard WorkerYou can see the complete process for releasing to Maven Central on the [OSSRH site] 218*cd0cc2e3SAndroid Build Coastguard Worker(http://central.sonatype.org/pages/releasing-the-deployment.html). 219*cd0cc2e3SAndroid Build Coastguard Worker 220*cd0cc2e3SAndroid Build Coastguard WorkerIt will take several hours for the jars to show up on [Maven Central](http://search.maven.org). 221*cd0cc2e3SAndroid Build Coastguard Worker 222*cd0cc2e3SAndroid Build Coastguard Worker### Build the Android Release 223*cd0cc2e3SAndroid Build Coastguard Worker 224*cd0cc2e3SAndroid Build Coastguard WorkerThe Android build is not yet integrated into the Docker container, so on any machine with 225*cd0cc2e3SAndroid Build Coastguard Workerthe Android SDK installed, do the following: 226*cd0cc2e3SAndroid Build Coastguard Worker 227*cd0cc2e3SAndroid Build Coastguard Worker1. Build the code. 228*cd0cc2e3SAndroid Build Coastguard Worker ```bash 229*cd0cc2e3SAndroid Build Coastguard Worker $ ./gradlew conscrypt-android:build 230*cd0cc2e3SAndroid Build Coastguard Worker $ ./gradlew conscrypt-android:publish -Dorg.gradle.parallel=false 231*cd0cc2e3SAndroid Build Coastguard Worker ``` 232*cd0cc2e3SAndroid Build Coastguard Worker1. Visit the OSSRH site and close and release the repository. 233*cd0cc2e3SAndroid Build Coastguard Worker 234*cd0cc2e3SAndroid Build Coastguard Worker### Build the Uber Jar 235*cd0cc2e3SAndroid Build Coastguard Worker 236*cd0cc2e3SAndroid Build Coastguard WorkerOnce the platform-specific jars have shown up on Maven Central, return to the Docker container 237*cd0cc2e3SAndroid Build Coastguard Workerand build the Uber jar. 238*cd0cc2e3SAndroid Build Coastguard Worker 239*cd0cc2e3SAndroid Build Coastguard Worker1. Build the code. 240*cd0cc2e3SAndroid Build Coastguard Worker ```bash 241*cd0cc2e3SAndroid Build Coastguard Worker # If you left the container, reattach to it 242*cd0cc2e3SAndroid Build Coastguard Worker $ docker container attach {CONTAINER_ID} 243*cd0cc2e3SAndroid Build Coastguard Worker $ ./gradlew conscrypt-openjdk-uber:build -Dorg.conscrypt.openjdk.buildUberJar=true 244*cd0cc2e3SAndroid Build Coastguard Worker $ ./gradlew conscrypt-openjdk-uber:publish -Dorg.gradle.parallel=false -Dorg.conscrypt.openjdk.buildUberJar=true 245*cd0cc2e3SAndroid Build Coastguard Worker ``` 246*cd0cc2e3SAndroid Build Coastguard Worker1. Visit the OSSRH site and close and release the repository. 247*cd0cc2e3SAndroid Build Coastguard Worker 248*cd0cc2e3SAndroid Build Coastguard Worker### Notify the Community 249*cd0cc2e3SAndroid Build Coastguard Worker 250*cd0cc2e3SAndroid Build Coastguard WorkerFinally, document and publicize the release. 251*cd0cc2e3SAndroid Build Coastguard Worker 252*cd0cc2e3SAndroid Build Coastguard Worker1. Add [Release Notes](https://github.com/google/conscrypt/releases) for the new tag. 253*cd0cc2e3SAndroid Build Coastguard Worker The description should include any major fixes or features since the last release. 254*cd0cc2e3SAndroid Build Coastguard Worker You may choose to add links to bugs, PRs, or commits if appropriate. 255*cd0cc2e3SAndroid Build Coastguard Worker2. Post a release announcement to [conscrypt](https://groups.google.com/forum/#!forum/conscrypt) 256*cd0cc2e3SAndroid Build Coastguard Worker (`[email protected]`). The title should be something that clearly identifies 257*cd0cc2e3SAndroid Build Coastguard Worker the release (e.g.`Conscrypt <tag> Released`). 258