From ecb14748c72edf1bc2e4fda94cbd0ae9376c0443 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Wed, 4 Sep 2024 14:04:49 +0300 Subject: [PATCH 1/3] feat(publish): add sonata to repositories --- publish.gradle | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/publish.gradle b/publish.gradle index 3fe58a18..3a681043 100644 --- a/publish.gradle +++ b/publish.gradle @@ -13,6 +13,7 @@ def pomConfig = { url "https://github.com:rees46/android-sdk/tree/master" } } +def urls = [rees46: "https://github.com/rees46/android-sdk", personaclick: "https://github.com/PersonaClick/android-sdk"] def publicationNames = [] publishing { @@ -108,10 +109,41 @@ publishing { url = uri(publishUrl) } + maven { + name = "sonatype" + + def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" + + credentials { + username ossrhUsername + password ossrhPassword + } + + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + } } } +def sonatypeIds = [rees46: sonatype_rees46, personaclick: sonatype_personaclick] + afterEvaluate { + nexusPublishing { + repositories { + android.libraryVariants.all { variant -> + if (variant.buildType.name == "debug") return + + "${variant.flavorName}Sonatype" { + stagingProfileId = sonatypeIds[variant.flavorName] + username = ossrhUsername + password = ossrhPassword + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + } + } + } + } + android.libraryVariants.all { variant -> if(variant == 'release') { tasks.javadoc.classpath += files(variant.javaCompileProvider.get().classpath) From f2742bd17cb973bd2f5181f190e5097f7cc22509 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Wed, 4 Sep 2024 15:28:14 +0300 Subject: [PATCH 2/3] feat(publish): add sonata creds --- .github/workflows/checks.yaml | 4 ++++ .github/workflows/publish.yaml | 16 ++++++++++++++++ publish.gradle | 10 ++++++---- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index b568e77c..eac2b923 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -20,8 +20,12 @@ jobs: URL: https://github.com/PersonaClick/android-sdk MAVEN_REPOSITORY_URL: https://maven.pkg.github.com/PersonaClick/android-sdk secrets: + SONATA_USERNAME: ${{ secrets.SONATA_USERNAME }} + SONATA_PASSWORD: ${{ secrets.SONATA_PASSWORD }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SONATYPE_REES46: ${{ secrets.SONATYPE_REES46 }} + SONATYPE_PERSONACLICK: ${{ secrets.SONATYPE_PERSONACLICK }} SIGNING_KEY_FILE_AS_BASE64_STRING: ${{ secrets.SIGNING_KEY_FILE_AS_BASE64_STRING }} GOOGLE_SERVICES_FILE_AS_BASE64_STRING: ${{ secrets.GOOGLE_SERVICES_FILE_AS_BASE64_STRING }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ec33645b..ed4d8207 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -25,10 +25,14 @@ jobs: URL: ${{ vars.REES_REPO_URL }} MAVEN_REPOSITORY_URL: ${{ vars.REES_MAVEN_URL }} secrets: + SONATA_USERNAME: ${{ secrets.SONATA_USERNAME }} + SONATA_PASSWORD: ${{ secrets.SONATA_PASSWORD }} appSecret: ${{ secrets.PUBLIVERSIONER_SECRET }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SONATYPE_REES46: ${{ secrets.SONATYPE_REES46 }} + SONATYPE_PERSONACLICK: ${{ secrets.SONATYPE_PERSONACLICK }} SIGNING_KEY_FILE_AS_BASE64_STRING: ${{ secrets.SIGNING_KEY_FILE_AS_BASE64_STRING }} publish-rees: @@ -44,10 +48,14 @@ jobs: URL: ${{ vars.REES_REPO_URL }} MAVEN_REPOSITORY_URL: ${{ vars.REES_MAVEN_URL }} secrets: + SONATA_USERNAME: ${{ secrets.SONATA_USERNAME }} + SONATA_PASSWORD: ${{ secrets.SONATA_PASSWORD }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} SIGNING_KEY_FILE_AS_BASE64_STRING: ${{ secrets.SIGNING_KEY_FILE_AS_BASE64_STRING }} + SONATYPE_REES46: ${{ secrets.SONATYPE_REES46 }} + SONATYPE_PERSONACLICK: ${{ secrets.SONATYPE_PERSONACLICK }} publish-persona: needs: version @@ -62,9 +70,13 @@ jobs: URL: ${{ vars.PERSONA_REPO_URL }} MAVEN_REPOSITORY_URL: ${{ vars.PERSONA_MAVEN_URL }} secrets: + SONATA_USERNAME: ${{ secrets.SONATA_USERNAME }} + SONATA_PASSWORD: ${{ secrets.SONATA_PASSWORD }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SONATYPE_REES46: ${{ secrets.SONATYPE_REES46 }} + SONATYPE_PERSONACLICK: ${{ secrets.SONATYPE_PERSONACLICK }} SIGNING_KEY_FILE_AS_BASE64_STRING: ${{ secrets.SIGNING_KEY_FILE_AS_BASE64_STRING }} release: @@ -81,8 +93,12 @@ jobs: URL: ${{ vars.REES_REPO_URL }} MAVEN_REPOSITORY_URL: ${{ vars.REES_MAVEN_URL }} secrets: + SONATA_USERNAME: ${{ secrets.SONATA_USERNAME }} + SONATA_PASSWORD: ${{ secrets.SONATA_PASSWORD }} appSecret: ${{ secrets.PUBLIVERSIONER_SECRET }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SONATYPE_REES46: ${{ secrets.SONATYPE_REES46 }} + SONATYPE_PERSONACLICK: ${{ secrets.SONATYPE_PERSONACLICK }} SIGNING_KEY_FILE_AS_BASE64_STRING: ${{ secrets.SIGNING_KEY_FILE_AS_BASE64_STRING }} diff --git a/publish.gradle b/publish.gradle index 3a681043..c9375c66 100644 --- a/publish.gradle +++ b/publish.gradle @@ -116,8 +116,8 @@ publishing { def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" credentials { - username ossrhUsername - password ossrhPassword + username sonataUsername + password sonataPassword } url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl @@ -135,8 +135,8 @@ afterEvaluate { "${variant.flavorName}Sonatype" { stagingProfileId = sonatypeIds[variant.flavorName] - username = ossrhUsername - password = ossrhPassword + username = sonataUsername + password = sonataPassword nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) } @@ -156,6 +156,8 @@ ext["signing.password"] = signing_password ext["signing.secretKeyRingFile"] = signing_secretKeyRingFile ext["ossrhUsername"] = ossrhUsername ext["ossrhPassword"] = ossrhPassword +ext["sonataUsername"] = sonataUsername +ext["sonataPassword"] = sonataPassword ext["variantName"] = variantName ext["url"] = url ext["publishUrl"] = publishUrl From 80bbe013f1fea63ed1bb98a486706af3dec434dc Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Wed, 4 Sep 2024 15:47:27 +0300 Subject: [PATCH 3/3] chore(publish): format --- publish.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/publish.gradle b/publish.gradle index c9375c66..5d839af3 100644 --- a/publish.gradle +++ b/publish.gradle @@ -124,7 +124,6 @@ publishing { } } } - def sonatypeIds = [rees46: sonatype_rees46, personaclick: sonatype_personaclick] afterEvaluate {