Skip to content

Commit

Permalink
Update release steps (#2503)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodbx authored Aug 28, 2024
1 parent 1a6c2f6 commit 0d5e911
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: build

on: [push, pull_request]
on:
pull_request: {}

push:
branches:
- '**'
tags-ignore:
- '**'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: release

on:
push:
tags:
- '**'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Publish Artifacts
run: ./gradlew publishMavenPublicationToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
26 changes: 7 additions & 19 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
Releasing
========

1. Change the version in `gradle.properties` to a non-SNAPSHOT version.
2. Update the `CHANGELOG.md` for the impending release.
1. Update `VERSION_NAME` in `gradle.properties` to the release (non-SNAPSHOT) version.
2. Update `CHANGELOG.md` for the impending release.
3. Update the `README.md` with the new version.
4. `git commit -am "Prepare for release X.Y.Z"` (where X.Y.Z is the new version)
5. `./gradlew clean publishMavenPublicationToMavenCentralRepository`
6. Visit [Sonatype Nexus](https://s01.oss.sonatype.org/) and promote the artifacts.
7. `git tag -a X.Y.Z -m "X.Y.Z"` (where X.Y.Z is the new version)
8. Update the `gradle.properties` to the next SNAPSHOT version.
9. `git commit -am "Prepare next development version"`
10. `git push && git push --tags`
5. `git tag -a X.Y.Z -m "X.Y.Z"` (where X.Y.Z is the new version)
6. Update `VERSION_NAME` in `gradle.properties` to the next SNAPSHOT version.
7. `git commit -am "Prepare next development version"`
8. `git push && git push --tags`


If step 5 or 6 fails, drop the Sonatype repo, fix the problem, commit, and start again at step 4.


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

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

* `mavenCentralUsername` - Sonatype username for releasing to `com.squareup`.
* `mavenCentralPassword` - Sonatype password for releasing to `com.squareup`.
This will trigger a GitHub Action workflow which will upload the release artifacts to Maven Central.

0 comments on commit 0d5e911

Please # to comment.