Skip to content

Commit 8992657

Browse files
authored
Migrate to Central Portal for Maven Publishing (#684)
1 parent fecd9b6 commit 8992657

File tree

3 files changed

+8
-32
lines changed

3 files changed

+8
-32
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
- name: Publish to Maven Central
2222
run: ./gradlew publishToMavenCentral --no-configuration-cache
2323
env:
24-
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
25-
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
24+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
25+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
2626
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
2727
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
2828
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}

MAINTAINING.md

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,25 @@ You are ready to release a new version of the Kotlin toolkit? Great, follow thes
2727
* Add an APK to the release page **with LCP enabled**.
2828
6. Publish to Maven Central.
2929
1. Verify that the [`Publish` workflow](https://github.com/readium/kotlin-toolkit/actions/workflows/publish.yml) successfully pushed and closed the release to Maven Central.
30-
2. Sign in to https://s01.oss.sonatype.org/
31-
3. Verify the content of the staging repository.
32-
4. Release the staging repository.
30+
2. Sign in to https://central.sonatype.com/publishing/deployments
31+
3. Verify the content of the components.
32+
4. Publish the components
3333
7. Check that the new modules can be imported in an Android project from Maven Central.
3434
8. Merge `develop` into `main`.
3535

3636
### Publishing to Maven Central manually
3737

3838
If the `Publish` workflow fails, you may need to publish to Maven Central manually.
3939

40-
[The Sonatype issue for Readium is located here](https://issues.sonatype.org/browse/OSSRH-85964).
41-
4240
#### With the new vanniktech's Maven publish plugin
4341

4442
1. Make sure you have the secrets in `.envrc` and [direnv](https://direnv.net) installed.
4543
2. Run:
4644
```
4745
./gradlew publishToMavenCentral --no-configuration-cache
4846
```
49-
3. Sign in to https://s01.oss.sonatype.org/
50-
4. Publish manually the previously closed Staging repository
51-
52-
### (Deprecated) With the official Maven publish plugin
53-
54-
1. Make sure you have the secrets in `local.properties`.
55-
2. Run:
56-
```
57-
./gradlew clean assembleRelease
58-
./gradlew androidSourcesJar javadocJar
59-
./gradlew publishReleasePublicationToSonatypeRepository closeSonatypeStagingRepository
60-
```
61-
3. Sign in to https://s01.oss.sonatype.org/
62-
4. Publish manually the previously closed Staging repository
63-
64-
Note that [you can't run the gradlew commands separately](https://github.com/gradle-nexus/publish-plugin#publishing-and-closing-in-different-gradle-invocations), otherwise you get this error:
65-
66-
> No staging repository with name sonatype created
47+
3. Sign in to https://central.sonatype.com/publishing/deployments
48+
4. Publish manually the components
6749

6850
## Troubleshooting
6951

buildSrc/src/main/kotlin/readium.library-conventions.gradle.kts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ mavenPublishing {
8989
name.set("Quentin Gliosca")
9090
email.set("[email protected]")
9191
}
92-
93-
developer {
94-
id.set("username")
95-
name.set("User Name")
96-
url.set("https://github.com/username/")
97-
}
9892
}
9993
scm {
10094
url.set("https://github.com/readium/kotlin-toolkit")
@@ -103,6 +97,6 @@ mavenPublishing {
10397
}
10498
}
10599

106-
publishToMavenCentral(SonatypeHost.S01)
100+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
107101
signAllPublications()
108102
}

0 commit comments

Comments
 (0)