Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,27 @@ jobs:
distribution: temurin
- name: Build with Gradle
run: ./gradlew build
- name: Publish
- name: Verify JReleaser configuration
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
JRELEASER_NEXUS2_USERNAME: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
run: ./gradlew jreleaserConfig
- name: Build artifacts
if: ${{ github.ref == 'refs/heads/main' || startswith(github.ref, 'refs/tags/') }}
env:
SIGNING_PRIVATE_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}
SIGNING_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.SONATYPE_S01_USERNAME }}
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.SONATYPE_S01_PASSWORD }}
run: ./gradlew publish
- name: Deploy artifacts
if: ${{ github.ref == 'refs/heads/main' || startswith(github.ref, 'refs/tags/') }}
env:
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
JRELEASER_NEXUS2_USERNAME: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
run: ./gradlew jreleaserDeploy
- name: Upload reports
if: success() || failure()
uses: actions/upload-artifact@v4
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
apply from: "gradle/jreleaser.gradle"

allprojects {
pluginManager.withPlugin('maven-publish') {
apply from: "${rootDir}/gradle/publish.gradle"
Expand Down
43 changes: 43 additions & 0 deletions gradle/jreleaser.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apply plugin: 'base'
apply plugin: 'org.jreleaser'

jreleaser {
deploy {
maven {
mavenCentral {
sonatype {
active = 'RELEASE'
url = 'https://central.sonatype.com/api/v1/publisher'
sign = false
applyMavenCentralRules = true
stagingRepository('build/staging-deploy')
namespace = 'com.contentgrid'
}
}
nexus2 {
'sonatype-snapshot' {
active = 'SNAPSHOT'
snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
sign = false
applyMavenCentralRules = true
snapshotSupported = true
closeRepository = true
releaseRepository = true
stagingRepository('build/staging-deploy')
}
}
}
}
// It is required to configure at least one release provider.
// But you can provide any non-existing non-empty GitHub token and skip creating tags and releases.
// see https://github.com/jreleaser/jreleaser/discussions/1725
gitRootSearch = true
release {
github {
enabled = true
skipTag = true
skipRelease = true
token = '__UNUSED__'
}
}
}
18 changes: 2 additions & 16 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,8 @@ publishing {
}

repositories {
if ("${project.version}".endsWith('-SNAPSHOT')) {
sonatypeSnapshots {
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
credentials {
username = project.findProperty('sonatype_username')
password = project.findProperty('sonatype_password')
}
}
} else {
sonatypeMavenCentral {
url = "https://s01.oss.sonatype.org/service/local/"
credentials {
username = project.findProperty('sonatype_username')
password = project.findProperty('sonatype_password')
}
}
maven {
url = uri("${rootDir}/build/staging-deploy")
}
}
}
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'eu.xenit.enterprise-conventions.oss' version '0.5.2'
id 'org.ajoberstar.reckon.settings' version '0.19.2'
id 'org.jreleaser' version '1.19.0' apply false
}

rootProject.name = 'opa-java-client'
Expand Down