diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index cabf02d..86ed977 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -12,7 +12,15 @@ 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. +# Publish Snapshot workl # - name: Ensure this isn't a -SNAPSHOT version # uses: rickbusarow/actions/gradle-task@bf0940965387f10bcb8b6699a79499d18167dfbe # v1 # with: @@ -22,7 +30,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: diff --git a/RELEASING.md b/RELEASING.md index 7e7f5ce..1026b3f 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -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 -# Confirm the key can now be found -gpg --recv-keys --keyserver keyserver.ubuntu.com -``` - -### Set up your home gradle.properties - -Add this to your `~/.gradle/gradle.properties`: - -``` -signing.keyId= -signing.password= -signing.secretKeyRingFile=/Users/YOUR_USERNAME_/.gnupg/secring.gpg -SONATYPE_NEXUS_USERNAME= -SONATYPE_NEXUS_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 @@ -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 ``` @@ -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 @@ -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 @@ -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. \ No newline at end of file +* Tell your friends, update all of your apps, and tweet the new release. + As a nice extra touch, mention external contributions.