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 3fe58a18..5d839af3 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,40 @@ 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 sonataUsername + password sonataPassword + } + + 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 = sonataUsername + password = sonataPassword + 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) @@ -124,6 +155,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