Skip to content

Commit

Permalink
Update the 4.x releasing doc
Browse files Browse the repository at this point in the history
  • Loading branch information
swankjesse committed Oct 17, 2023
1 parent a64a116 commit ac4a282
Showing 1 changed file with 15 additions and 76 deletions.
91 changes: 15 additions & 76 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,3 @@
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>
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`.

2. Set versions:
Expand All @@ -67,14 +7,7 @@ Cutting a Release
export NEXT_VERSION=X.Y.Z-SNAPSHOT
```

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:
3. Update versions:

```
sed -i "" \
Expand All @@ -86,23 +19,29 @@ Cutting a Release
sed -i "" \
"s/\/com.squareup.okhttp3\/\([^\:]*\)\/[^\/]*\//\/com.squareup.okhttp3\/\1\/$RELEASE_VERSION\//g" \
`find . -name "README.md"`
./gradlew clean publishAllPublicationsToMavencentralRepository
```

5. Visit [Sonatype Nexus][sonatype_nexus] to promote (close then release) the artifact. Or drop it
if there is a problem!

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

```
git commit -am "Prepare for release $RELEASE_VERSION."
git tag -a parent-$RELEASE_VERSION -m "Version $RELEASE_VERSION"
git push && git push --tags
```

5. Wait for [GitHub Actions][github_actions] to start the publish job.

6. Prepare for ongoing development and push to GitHub.

```
sed -i "" \
"s/version = '.*'/version = '$NEXT_VERSION'/g" \
build.gradle
git commit -am "Prepare next development version."
git push && git push --tags
git push
```

[sonatype_issues]: https://issues.sonatype.org/
[sonatype_nexus]: https://oss.sonatype.org/
7. Confirm the [GitHub Actions][github_actions] publish job succeeded.

[github_actions]: https://github.com/square/okhttp/actions
[sonatype_issues]: https://issues.sonatype.org/

0 comments on commit ac4a282

Please sign in to comment.