Skip to content

Commit 5b23df7

Browse files
authored
Make the publish action work like Okio's (square#9202)
* Make the publish action work like Okio's * Keep publishing snapshots
1 parent 442de1c commit 5b23df7

2 files changed

Lines changed: 30 additions & 23 deletions

File tree

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
env:
9+
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
10+
11+
jobs:
12+
publish:
13+
runs-on: macos-15
14+
15+
steps:
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-java@v5
18+
with:
19+
distribution: 'zulu'
20+
java-version-file: .github/workflows/.java-version
21+
22+
- run: ./gradlew publish
23+
env:
24+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
25+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
26+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}

docs/releasing.md

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
Releasing
22
=========
33

4-
### Prerequisite: Sonatype (Maven Central) Account
5-
6-
Create an account on the [Sonatype issues site][sonatype_issues]. Ask an existing publisher to open
7-
an issue requesting publishing permissions for `com.squareup` projects.
8-
9-
10-
Cutting a Release
11-
-----------------
12-
134
1. Update `CHANGELOG.md`.
145

156
2. Set versions:
@@ -19,7 +10,7 @@ Cutting a Release
1910
export NEXT_VERSION=X.Y.Z-SNAPSHOT
2011
```
2112
22-
3. Update versions:
13+
3. Update versions, tag the release, and prepare for the next release.
2314
2415
```
2516
sed -i "" \
@@ -31,29 +22,18 @@ Cutting a Release
3122
sed -i "" \
3223
"s/\/com.squareup.okhttp3\/\([^\:]*\)\/[^\/]*\//\/com.squareup.okhttp3\/\1\/$RELEASE_VERSION\//g" \
3324
`find . -name "README.md"`
34-
```
35-
36-
4. Tag the release and push to GitHub.
3725
38-
```
3926
git commit -am "Prepare for release $RELEASE_VERSION."
4027
git tag -a parent-$RELEASE_VERSION -m "Version $RELEASE_VERSION"
4128
git push && git push --tags
42-
```
43-
44-
5. Wait for [GitHub Actions][github_actions] to start the publish job.
4529
46-
6. Prepare for ongoing development and push to GitHub.
47-
48-
```
49-
sed -i "" \
30+
sed -i "" \
5031
"s/version = \".*\"/version = \"$NEXT_VERSION\"/g" \
5132
build.gradle.kts
5233
git commit -am "Prepare next development version."
5334
git push
5435
```
5536
56-
7. Confirm the [GitHub Actions][github_actions] publish job succeeded.
37+
4. Wait for [GitHub Actions][github_actions] to build and promote the release.
5738
5839
[github_actions]: https://github.com/square/okhttp/actions
59-
[sonatype_issues]: https://issues.sonatype.org/

0 commit comments

Comments
 (0)