Skip to content

Commit

Permalink
Add repository and signing configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave committed Dec 1, 2023
1 parent 72b6230 commit 4f9c641
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ jobs:
key: ${{ steps.rust-toolchain.outputs.cachekey }}
workspaces: divviup/rust
- name: Upload artifacts
run: ./gradlew :divviup:uploadArtifacts
env:
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_SIGNING_PASSPHRASE }}
run: ./gradlew :divviup:publishReleasePublicationToOSSRHRepository
34 changes: 34 additions & 0 deletions divviup/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id("com.android.library")
id("org.mozilla.rust-android-gradle.rust-android")
id("maven-publish")
signing
}

android {
Expand Down Expand Up @@ -127,4 +128,37 @@ publishing {
}
}
}

repositories {
maven {
name = "OSSRH"

val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl

authentication {
register<BasicAuthentication>("basic")
}

credentials {
val ossrhUsername: String? by project
val ossrhPassword: String? by project
username = ossrhUsername
password = ossrhPassword
}
}
}
}

signing {
sign(publishing.publications["release"])

val signingKey: String? by project
val signingPassword: String? by project
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
} else {
useGpgCmd()
}
}

0 comments on commit 4f9c641

Please sign in to comment.