diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 7eccd2ac9..8f9a5c9e4 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -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: diff --git a/.github/workflows/tag-and-release.yml b/.github/workflows/tag-and-release.yml index 40e9fbab3..cbcb57bbb 100644 --- a/.github/workflows/tag-and-release.yml +++ b/.github/workflows/tag-and-release.yml @@ -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 diff --git a/build.gradle b/build.gradle index 159373a9a..e8a750efe 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { @@ -165,6 +219,7 @@ jar { 'Main-Class': 'dev.jbang.Main', ) } + duplicatesStrategy = DuplicatesStrategy.EXCLUDE } compileJava { diff --git a/jreleaser.yml b/jreleaser.yml index a3b118e82..029e3d1e1 100644 --- a/jreleaser.yml +++ b/jreleaser.yml @@ -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