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

Updates RELEASING.md to use publish-release.yml. #166

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2

# checkVersionIsNotSnapshot doesn't exist in Rick's horde. Pretty trivial to re-implement,
# but also not crucial while this is not part of CI (unlikely ever to happen). And in the meantime,
# quite handy to leave this check out so that we can use this workflow to publish
# SNAPSHOTs.
#
# OTOH, if we get around to making a Publish Snapshot alternative to this workflow
# and tie it to CI, having a checkVersionIsSnapshot task will be very important for that.
# - name: Ensure this isn't a -SNAPSHOT version
# uses: rickbusarow/actions/gradle-task@bf0940965387f10bcb8b6699a79499d18167dfbe # v1
# with:
Expand All @@ -22,7 +29,10 @@ jobs:
uses: rickbusarow/actions/gradle-task@bf0940965387f10bcb8b6699a79499d18167dfbe # v1
with:
task: assemble
#

# artifactsCheck doesn't exist in Rick's horde, so we continue to rely on manual discipline
# to run tests locally before publishing. Could copy this from workflow, but it's tied
# to the build-logic system there so doing so would be Actual Work.
# - name: Check
# uses: rickbusarow/actions/gradle-task@bf0940965387f10bcb8b6699a79499d18167dfbe # v1
# with:
Expand Down
58 changes: 8 additions & 50 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,10 @@
# Releasing

## Preparing the release environment

### Set up your Sonatype OSSRH account

* Create a [Sonatype OSSRH JIRA account](https://issues.sonatype.org/secure/Signup!default.jspa).
* Create a ticket to request access to the `com.squareup.radiography` project. Here's an example: [OSSRH-54959](https://issues.sonatype.org/browse/OSSRH-54959).
* Then ask someone with deployer role from the team to confirm access.

### Set up your signing key

```bash
# Create a new key
gpg --gen-key
# List local keys. Key id is last 8 characters
gpg -K
cd ~/.gnupg
# Export key locally
gpg --export-secret-keys -o secring.gpg
# Upload key to Ubuntu servers
gpg --send-keys --keyserver keyserver.ubuntu.com <KEY ID>
# Confirm the key can now be found
gpg --recv-keys --keyserver keyserver.ubuntu.com <KEY ID>
```

### Set up your home gradle.properties

Add this to your `~/.gradle/gradle.properties`:

```
signing.keyId=<KEY ID>
signing.password=<KEY PASSWORD>
signing.secretKeyRingFile=/Users/YOUR_USERNAME_/.gnupg/secring.gpg
SONATYPE_NEXUS_USERNAME=<SONATYPE_USERNAME>
SONATYPE_NEXUS_PASSWORD=<SONATYPE_PASSWORD>
```

### Set up GitHub CLI

Install GitHub CLI

* Install GitHub CLI if needed
```bash
brew install gh
```

## Releasing

* Create a local release branch from `main`
```bash
git checkout main
Expand All @@ -59,12 +18,12 @@ sed -i '' 's/VERSION_NAME={NEW_VERSION}-SNAPSHOT/VERSION_NAME={NEW_VERSION}/' gr
```

* Update the changelog
```
```bash
mate CHANGELOG.md
```

* Update the released version in the readme
```
```bash
mate README.md
```

Expand All @@ -75,8 +34,7 @@ git commit -am "Prepare {NEW_VERSION} release"

* Perform a clean build
```bash
./gradlew clean
./gradlew build
./gradlew clean && build && connectedCheck
```

* Create a tag and push it
Expand All @@ -85,10 +43,9 @@ git tag v{NEW_VERSION}
git push origin v{NEW_VERSION}
```

* Upload the artifacts to Sonatype OSS Nexus
* Run the _Publish Release_ workflow
```bash
./gradlew publish --no-daemon --no-parallel --no-configuration-cache && \
./gradlew closeAndReleaseRepository
gh workflow run publish-release.yml --ref v{NEW_VERSION}
```

* Merge the release branch to main
Expand Down Expand Up @@ -118,4 +75,5 @@ gh release create v{NEW_VERSION} --title v{NEW_VERSION} --notes 'See [Change Log
```

* Wait for the release to be available [on Maven Central](https://repo1.maven.org/maven2/com/squareup/radiography/radiography/).
* Tell your friends, update all of your apps, and tweet the new release. As a nice extra touch, mention external contributions.
* Tell your friends, update all of your apps, and tweet the new release.
As a nice extra touch, mention external contributions.
Loading