Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include prerequisites in the releasing guide. #5362

Merged
merged 1 commit into from Aug 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 70 additions & 12 deletions docs/releasing.md
@@ -1,6 +1,63 @@
Releasing
=========

### Prerequisite: Sonatype (Maven Central) Account

Create an account on the [Sonatype issues site][sonatype_issues]. Ask an existing publisher to open
an issue requesting publishing permissions for `com.squareup` projects.

### Prerequisite: GPG Keys

Generate a GPG key (RSA, 4096 bit, 3650 day) expiry, or use an existing one. You should leave the
password empty for this key.

```
$ gpg --full-generate-key
```

Upload the GPG keys to public servers:

```
$ gpg --list-keys --keyid-format LONG
/Users/johnbarber/.gnupg/pubring.kbx
------------------------------
pub rsa4096/XXXXXXXXXXXXXXXX 2019-07-16 [SC] [expires: 2029-07-13]
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
uid [ultimate] John Barber <jbarber@squareup.com>
Copy link
Collaborator

Choose a reason for hiding this comment

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

lol

sub rsa4096/ZZZZZZZZZZZZZZZZ 2019-07-16 [E] [expires: 2029-07-13]

$ gpg --send-keys --keyserver keyserver.ubuntu.com XXXXXXXXXXXXXXXX
```

### Prerequisite: Gradle Properties

Define publishing properties in `~/.gradle/gradle.properties`:

```
signing.keyId=1A2345F8
signing.password=
signing.secretKeyRingFile=/Users/jbarber/.gnupg/secring.gpg
```

`signing.keyId` is the GPG key's ID. Get it with this:

```
$ gpg --list-keys --keyid-format SHORT
```

`signing.password` is the password for this key. This might be empty!

`signing.secretKeyRingFile` is the absolute path for `secring.gpg`. You may need to export this
file manually with the following command where `XXXXXXXX` is the `keyId` above:

```
$ gpg --keyring secring.gpg --export-secret-key XXXXXXXX > ~/.gnupg/secring.gpg
```


Cutting a Release
-----------------

1. Update `CHANGELOG.md`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

just an idea: is it useful if it's hyperlinked? it doesn't have to be though :)

[CHANGELOG.md][changelog_url]

[changelog_url]: https://github.com/square/okhttp/blob/master/CHANGELOG.md


2. Set versions:
Expand All @@ -10,7 +67,14 @@ Releasing
export NEXT_VERSION=X.Y.Z-SNAPSHOT
Copy link
Collaborator

Choose a reason for hiding this comment

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

just wanted to make sure. is the example of this like below? 👀

export RELEASE_VERSION=4.0.2
export NEXT_VERSION=4.0.3-SNAPSHOT

Copy link
Member Author

Choose a reason for hiding this comment

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

yep!

```

3. Update, build, and upload:
3. Set environment variables with your [Sonatype credentials][sonatype_issues].

```
export SONATYPE_NEXUS_USERNAME=johnbarber
export SONATYPE_NEXUS_PASSWORD=`pbpaste`
```

4. Update, build, and upload:

```
sed -i "" \
Expand All @@ -22,9 +86,10 @@ Releasing
./gradlew clean uploadArchives
```

4. Visit [Sonatype Nexus](https://oss.sonatype.org/) to promote the artifact. Or drop it if there is a problem!
5. Visit [Sonatype Nexus][sonatype_nexus] to promote (close then release) the artifact. Or drop it
if there is a problem!

5. Tag the release, prepare for the next one, and push to GitHub.
6. Tag the release, prepare for the next one, and push to GitHub.

```
git commit -am "Prepare for release $RELEASE_VERSION."
Expand All @@ -36,12 +101,5 @@ Releasing
git push && git push --tags
```


Prerequisites
-------------

In `~/.gradle/gradle.properties`, set the following:

* `SONATYPE_NEXUS_USERNAME` - Sonatype username for releasing to `com.squareup`.
* `SONATYPE_NEXUS_PASSWORD` - Sonatype password for releasing to `com.squareup`.

[sonatype_issues]: https://issues.sonatype.org/
[sonatype_nexus]: https://oss.sonatype.org/