Skip to content

Commit

Permalink
feat: sign and publish jar to mavencentral (#1705)
Browse files Browse the repository at this point in the history
* feat: sign and publish jar to mavencentral

* build: add releaser token info
  • Loading branch information
maxandersen authored Nov 19, 2023
1 parent a32dea9 commit b519dd5
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_VERSION: 1.5.1
JRELEASER_NEXUS2_USERNAME = $${{ secrets.OSSRH_USERNAME}}
JRELEASER_NEXUS2_PASSWORD = ${{ secrets.OSSRH_TOKEN }}
JRELEASER_VERSION: 1.9.0
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_NEXUS2_USERNAME = $${{ secrets.OSSRH_USERNAME}}
JRELEASER_NEXUS2_PASSWORD = ${{ secrets.OSSRH_TOKEN }}
JRELEASER_VERSION: 1.5.1
steps:
- uses: actions/checkout@v3
Expand Down
57 changes: 56 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,65 @@ plugins {
id "org.ajoberstar.grgit" version "4.1.1"
id "org.sonarqube" version "4.0.0.2929"
id 'jacoco'
id 'maven-publish'
}

//remove this to see all the missing tags/parameters.
javadoc.options.addStringOption('Xdoclint:none', '-quiet')

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
//maven { url 'https://jitpack.io' }
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
maven(MavenPublication) {
groupId = 'dev.jbang'
artifactId = 'jbang-cli'

from components.java

pom {
name = 'JBang CLI'
description = 'JBang Command Line Interface'
url = 'https://jbang.dev'
inceptionYear = '2019'
licenses {
license {
name = 'MIT'
url = 'https://github.com/jbangdev/jbang/blob/main/LICENSE'
}
}
developers {
developer {
id = 'maxandersen'
name = 'Max Rydahl Andersen'
}
developer {
id = 'quintesse'
name = 'Tako Schotanus'
}
}
scm {
connection = 'scm:git:https://github.com/jbangdev/jbang'
developerConnection = 'scm:git:https://github.com/jbangdev/jbang'
url = 'http://github.com/jbangdev/jbang'
}
}
}
}

repositories {
maven {
url = layout.buildDirectory.dir('staging-deploy')
}
}
}

sourceSets {
Expand Down Expand Up @@ -165,6 +219,7 @@ jar {
'Main-Class': 'dev.jbang.Main',
)
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

compileJava {
Expand Down
12 changes: 12 additions & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ signing:
active: ALWAYS
armored: true

deploy:
maven:
nexus2:
maven-central:
active: ALWAYS
url: https://oss.sonatype.org/service/local
snapshotUrl: https://oss.sonatype.org/content/repositories/snapshots/
closeRepository: true
releaseRepository: false
stagingRepositories:
- build/staging-deploy

announce:
twitter:
active: RELEASE
Expand Down

0 comments on commit b519dd5

Please sign in to comment.