Skip to content

Commit

Permalink
feat(publish): add sonata to repositories (#55)
Browse files Browse the repository at this point in the history
* feat(publish): add sonata to repositories

* feat(publish): add sonata creds

* chore(publish): format
  • Loading branch information
Nelfimov authored Sep 4, 2024
1 parent 839f379 commit 34cc2fc
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
16 changes: 16 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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 }}
33 changes: 33 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 34cc2fc

Please sign in to comment.