Skip to content

Commit a325e1b

Browse files
authored
ANDROID-16205 Migrate sonatype publishing to Central Portal (#24)
* ANDROID-16205 Migrate sonatype publishing to Central Portal * ANDROID-16205 Try snapshot * ANDROID-16205 use github param
1 parent 20a06e8 commit a325e1b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.github/workflows/snapshot.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Snapshot"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
snapshotVersion:
6+
description: "Snapshot version"
7+
required: true
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v2
15+
16+
- uses: actions/setup-java@v3
17+
with:
18+
distribution: 'temurin' # This is the Ubuntu Default
19+
java-version: '17'
20+
21+
- name: Build library
22+
run: 'bash ./gradlew clean :library:assembleRelease'
23+
24+
- name: Release library
25+
env:
26+
MOBILE_MAVENCENTRAL_USER: ${{ secrets.MOBILE_MAVENCENTRAL_USER }}
27+
MOBILE_MAVENCENTRAL_PASSWORD: ${{ secrets.MOBILE_MAVENCENTRAL_PASSWORD }}
28+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
29+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
30+
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }}
31+
run: "bash ./gradlew publishReleasePublicationToSonatypeRepository -DSNAPSHOT_VERSION=${{ github.event.inputs.snapshotVersion }} publishNoopPublicationToSonatypeRepository -DSNAPSHOT_VERSION=${{ github.event.inputs.snapshotVersion }}
32+
--max-workers 1 closeAndReleaseStagingRepositories"

publish_maven_central.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ nexusPublishing {
66
stagingProfileId = "f7fe7699e57a"
77
username = System.getenv("MOBILE_MAVENCENTRAL_USER")
88
password = System.getenv("MOBILE_MAVENCENTRAL_PASSWORD")
9+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
10+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
911
}
1012
}
1113
}

0 commit comments

Comments
 (0)