Skip to content

Commit 049eceb

Browse files
authored
Merge pull request #733 from bumble-tech/publishing-migration
Sonatype migration
2 parents e554681 + 5c11611 commit 049eceb

File tree

21 files changed

+126
-237
lines changed

21 files changed

+126
-237
lines changed

.github/workflows/build_1.x.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,14 @@ jobs:
3535
mergeDetektSarif
3636
:plugins:buildPlugins
3737
--continue
38-
- name: Check publication setup
39-
run: >
40-
./gradlew
41-
publishAppyxReleasePublicationToOSSRHRepository
42-
publishAppyxReleasePublicationToSonatypeSnapshotRepository
43-
--dry-run
44-
--no-parallel
4538
- name: Deploy snapshot
4639
if: env.MAIN_BRANCH == 'true' && github.repository == 'bumble-tech/appyx'
4740
env:
48-
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
49-
run: >
50-
./gradlew
51-
publishAppyxReleasePublicationToSonatypeSnapshotRepository
52-
-Psnapshot=true
53-
--no-parallel
54-
-Psigning.password=${{ secrets.SIGNING_PASSWORD }}
55-
-Psonatype.username=${{ secrets.SONATYPE_USERNAME }}
56-
-Psonatype.password=${{ secrets.SONATYPE_PASSWORD }}
41+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
42+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
43+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
44+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
45+
run: ./gradlew publishAllPublicationsToMavenCentralRepository -Psnapshot=true
5746
- uses: github/codeql-action/upload-sarif@v3
5847
if: success() || failure()
5948
with:

.github/workflows/build_2.x.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,11 @@ jobs:
3838
- name: Deploy snapshot
3939
if: env.MAIN_BRANCH == 'true' && github.repository == 'bumble-tech/appyx'
4040
env:
41-
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
42-
run: >
43-
./gradlew
44-
publishAllPublicationsToSonatypeSnapshotRepository
45-
-Psnapshot=true
46-
--no-parallel
47-
-Psigning.password=${{ secrets.SIGNING_PASSWORD }}
48-
-Psonatype.username=${{ secrets.SONATYPE_USERNAME }}
49-
-Psonatype.password=${{ secrets.SONATYPE_PASSWORD }}
41+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
42+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
43+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
44+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
45+
run: ./gradlew publishAllPublicationsToMavenCentralRepository -Psnapshot=true
5046
- uses: github/codeql-action/upload-sarif@v3
5147
if: success() || failure()
5248
with:

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
java-version: '17'
1818
- uses: gradle/wrapper-validation-action@v2
1919
- uses: gradle/actions/setup-gradle@v3
20-
env:
21-
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
2220
with:
2321
cache-read-only: true
24-
arguments: |
25-
publishAppyxReleasePublicationToOSSRHRepository
26-
--no-parallel
27-
-Psigning.password=${{ secrets.SIGNING_PASSWORD }}
28-
-Psonatype.username=${{ secrets.SONATYPE_USERNAME }}
29-
-Psonatype.password=${{ secrets.SONATYPE_PASSWORD }}
22+
- name: Build & publish
23+
env:
24+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
25+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
26+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
28+
# Plugin requires "--no-configuration-cache" flag
29+
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache

RELEASING.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,31 @@
22

33
## Automatic
44

5-
1. Create PR with following changes:
6-
1. Update version in `gradle.properties`.
7-
2. Create a new section with version name taking all changes from pending section.
8-
2. Create GitHub release with a tag name of the version and fill notes from pending changes section.
9-
3. Library is published to staging repository automatically with GitHub Action.
10-
4. Proceed to 'Closing staging repository'.
5+
1. Create a PR with the following changes:
6+
1. Update the version in `gradle.properties`.
7+
2. Create a new section with the version name, including all changes from the pending section.
8+
2. Create a GitHub release with a tag name matching the version and fill in the release notes using the pending changes section.
9+
3. The library will be published to the staging repository automatically via GitHub Actions.
10+
4. [Proceed to closing the staging repository](#closing-staging-repository).
1111

12-
In case of any issues you can launch Release manually from GitHub Actions tab.
12+
If any issues arise, you can manually launch the release from the GitHub Actions tab.
1313

1414
## Manual
1515

16-
Should be used in case if there are issues with automatic publication.
17-
18-
1. Create PR with following changes:
19-
1. Update version in `gradle.properties`.
20-
2. Create a new section with version name taking all changes from pending section.
21-
2. `./gradle publishAppyxReleasePublicationToOSSRHRepository --no-parallel -Psigning.keyId=$KEY_ID -Psigning.password=$PASS -Psigning.secretKeyRingFile=$FILE -Psonatype.username=$NAME -Psonatype.password=$PASS`
22-
1. `signing` properties are related to signing information.
23-
2. `sonatype` properties are your username and password from `oss.sonatype.org`.
24-
3. `--no-parallel` is required to avoid creation of multiple staging repositories.
25-
3. Create GitHub release with a tag name of the version and fill notes from pending changes section.
26-
4. Cancel Release GitHub Action as it will fail now because version is already released.
27-
5. Proceed to 'Closing staging repository'.
28-
29-
## Closing staging repository
30-
31-
1. Open `https://s01.oss.sonatype.org` and sign in with the sonatype credentials.
32-
2. Click `Staging Repositories`.
33-
3. Select the repository (assuming publish succeeded) and click the close button.
34-
4. Select the repository again and click release.
16+
This process should be used if there are issues with automatic publication.
17+
18+
1. Create a PR with the following changes:
19+
1. Update the version in `gradle.properties`.
20+
2. Create a new section with the version name, including all changes from the pending section.
21+
2. Refer to [.github/workflows/release.yml](.github/workflows/release.yml) for the manual release process.
22+
- Check the [vanniktech.github.io plugin documentation](https://vanniktech.github.io/gradle-maven-publish-plugin/central/#secrets) to learn how to use Gradle properties instead of environment variables.
23+
3. Create a GitHub release with the version's tag name and fill in the release notes using the pending changes section.
24+
4. Cancel the `Release` GitHub Action, as it will fail because the version has already been released.
25+
5. [Proceed to closing the staging repository](#closing-staging-repository).
26+
27+
## Closing the Staging Repository
28+
29+
1. Open [Sonatype Central](https://central.sonatype.com/publishing) and sign in with the Sonatype credentials.
30+
2. Click `Deployments` and then `Publish` once validated.
31+
32+
For more information, refer to [the official documentation](https://central.sonatype.org/publish/publish-portal-guide/#component-validation).

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import com.android.Version
21
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
32
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
43
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ junit-vintage = { module = "org.junit.vintage:junit-vintage-engine", version.ref
7676
plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
7777
plugin-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
7878
plugin-android = { module = "com.android.tools.build:gradle", version.ref = "agp" }
79+
plugin-publish = { module = "com.vanniktech.maven.publish:com.vanniktech.maven.publish.gradle.plugin", version = "0.31.0" }
80+
plugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "2.0.0" }
7981

8082
detekt-compose = "io.nlopez.compose.rules:detekt:0.1.6"
8183
toolargetool = "com.gu.android:toolargetool:0.3.0"

libraries/core/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
alias(libs.plugins.compose.compiler)
66
id("kotlin-android")
77
id("kotlin-parcelize")
8-
id("appyx-publish-android")
8+
id("appyx-publish")
99
id("appyx-lint")
1010
id("appyx-detekt")
1111
}

libraries/customisations/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import org.jetbrains.kotlin.config.JvmTarget
22
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
33

44
plugins {
5-
id("java-library")
6-
id("kotlin")
7-
id("appyx-publish-java")
5+
id("org.jetbrains.kotlin.jvm")
6+
id("appyx-publish")
87
id("appyx-detekt")
98
}
109

libraries/interop-ribs/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
alias(libs.plugins.compose.compiler)
66
id("kotlin-android")
77
id("kotlin-parcelize")
8-
id("appyx-publish-android")
8+
id("appyx-publish")
99
id("appyx-lint")
1010
id("appyx-detekt")
1111
}

libraries/interop-rx2/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import org.jetbrains.kotlin.config.JvmTarget
33
plugins {
44
id("com.android.library")
55
id("kotlin-android")
6-
id("appyx-publish-android")
6+
id("appyx-publish")
77
id("appyx-lint")
88
id("appyx-detekt")
99
}

0 commit comments

Comments
 (0)