Skip to content

Commit

Permalink
Publishing to sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
Duzhinsky committed Aug 31, 2023
1 parent 792f291 commit 3dc0ed1
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 6 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/publish-gh.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Publish to GitHub packages
name: Publish packages

on: [release]
on: [ release ]

jobs:
publish:
Expand All @@ -16,7 +16,16 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
- name: Get gpg keys
run: |
echo '${{secrets.MVN_GPG_ENCRYPTED}}' | base64 -d > publish_key.gpg
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.MVN_GPG_PASS}}" \
--output secret.gpg publish_key.gpg
- name: Get release version
run: echo "::set-env name=RELEASE_VERSION::${GITHUB_REF:11}"
- name: Publish gradle
run: ./gradlew publish
run: ./gradlew publish -Psigning.keyId=${{secrets.MVN_GPG_KEYID}} -Psigning.secretKeyRingFile=secret.gpg -Psigning.password=${{secrets.MVN_GPG_PASS}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ tasks.test {

allprojects {

group = "org.sudu"
version = "0.1"
group = "io.github.suduide"
version = "0.0.1"

apply(plugin = "java-library")
apply(plugin = "test-report-aggregation")
Expand Down
52 changes: 52 additions & 0 deletions options/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,62 @@
plugins {
id("com.google.protobuf") version "0.9.1"
`maven-publish`
signing
}

java {
withJavadocJar()
withSourcesJar()
}

signing {
sign(publishing.publications)
}

publishing {
publications {
create<MavenPublication>("maven") {
pom {

description = "Options for protogen tool. Use it as protogen scope dependency"
name = "protogen-options"
url = "https://github.com/SuduIDE/protogen"
organization {
name = "com.github.SuduIDE"
url = "https://github.com/SuduIDE"
}
issueManagement {
system = "GitHub"
url = "https://github.com/SuduIDE/protogen/issues"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
url = "https://github.com/SuduIDE/protogen"
connection = "scm:https://github.com/SuduIDE/protogen.git"
developerConnection = "scm:git://github.com/SuduIDE/protogen.git"
}
developers {
developer {
id = "Duzhinsky"
name = "Dmitrii Duzhinskii"
email = "[email protected]"
}
}
}

groupId = project.group.toString()
artifactId = "protogen-options"
version = project.version.toString()

from(components["java"])
}
}

repositories {
maven {
name = "ghPackages"
Expand All @@ -22,6 +66,14 @@ publishing {
password = System.getenv("GITHUB_TOKEN")
}
}
maven {
name = "sonatype"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
}

Expand Down

0 comments on commit 3dc0ed1

Please sign in to comment.