Skip to content

Commit

Permalink
fix: add maven central publishing (#13)
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Baliasnikov <anton.baliasnikov@iohk.io>
  • Loading branch information
Anton Baliasnikov authored Dec 7, 2023
1 parent 3603a29 commit ff4de95
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
GIT_COMMITTER_EMAIL: ${{ steps.import_gpg.outputs.email }}
GIT_AUTHOR_NAME: ${{ steps.import_gpg.outputs.name }}
GIT_COMMITTER_NAME: ${{ steps.import_gpg.outputs.name }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN: ${{ secrets.BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN }}
# Password is empty string, no need to set it
SIGNING_KEY_PASSWORD: ""
run: |
npm install
npx semantic-release
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# atala-automation
# Atala Automation

Common automation place for all Atala projects
63 changes: 53 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import java.util.*

plugins {
kotlin("jvm") version "1.8.21"
`java-library`
`maven-publish`
id("io.gitlab.arturbosch.detekt") version "1.23.0"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1"
signing
}

group = "io.iohk.atala"
Expand Down Expand Up @@ -44,17 +48,38 @@ java {

publishing {
publications {
create<MavenPublication>("maven") {
create<MavenPublication>(rootProject.name) {
from(components["java"])
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/input-output-hk/atala-automation")
credentials {
username = System.getenv("ATALA_GITHUB_ACTOR")
password = System.getenv("ATALA_GITHUB_TOKEN")
groupId = "io.iohk.atala"
artifactId = name
version = project.version.toString()
pom {
name.set("Atala PRISM Automation Helpers")
description.set("Automation helpers for PRISM identity ecosystem.")
url.set("https://docs.atalaprism.io/")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("amagyar-iohk")
name.set("Allain Magyar")
email.set("allain.magyar@iohk.io")
}
developer {
id.set("antonbaliasnikov")
name.set("Anton Baliasnikov")
email.set("anton.baliasnikov@iohk.io")
}
}
scm {
connection.set("scm:git:git://input-output-hk/atala-automation.git")
developerConnection.set("scm:git:ssh://input-output-hk/atala-automation.git")
url.set("https://github.com/input-output-hk/atala-automation")
}
}
}
}
Expand All @@ -68,3 +93,21 @@ detekt {
buildUponDefaultConfig = true
config.setFrom("detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}

signing {
val base64EncodedAsciiArmoredSigningKey: String = System.getenv("BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN") ?: ""
val signingKeyPassword: String = System.getenv("SIGNING_KEY_PASSWORD") ?: ""
useInMemoryPgpKeys(String(Base64.getDecoder().decode(base64EncodedAsciiArmoredSigningKey.toByteArray())), signingKeyPassword)
sign(publishing.publications)
}

0 comments on commit ff4de95

Please sign in to comment.