diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000000..58aca61cfc69 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +name: publish + +on: + push: + tags: + - '**' + +env: + GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" + +jobs: + publish: + runs-on: macos-15 + + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version-file: .github/workflows/.java-version + + - run: ./gradlew publish + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }} diff --git a/docs/releasing.md b/docs/releasing.md index 0799290dd09d..ccb88a8f77a8 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -1,15 +1,6 @@ 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. - - -Cutting a Release ------------------ - 1. Update `CHANGELOG.md`. 2. Set versions: @@ -19,7 +10,7 @@ Cutting a Release export NEXT_VERSION=X.Y.Z-SNAPSHOT ``` -3. Update versions: +3. Update versions, tag the release, and prepare for the next release. ``` sed -i "" \ @@ -31,29 +22,18 @@ Cutting a Release sed -i "" \ "s/\/com.squareup.okhttp3\/\([^\:]*\)\/[^\/]*\//\/com.squareup.okhttp3\/\1\/$RELEASE_VERSION\//g" \ `find . -name "README.md"` - ``` - -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 "" \ + sed -i "" \ "s/version = \".*\"/version = \"$NEXT_VERSION\"/g" \ build.gradle.kts git commit -am "Prepare next development version." git push ``` -7. Confirm the [GitHub Actions][github_actions] publish job succeeded. +4. Wait for [GitHub Actions][github_actions] to build and promote the release. [github_actions]: https://github.com/square/okhttp/actions -[sonatype_issues]: https://issues.sonatype.org/