Skip to content

Commit

Permalink
ALFREDOPS-849 use entreprise-conventions-gradle-plugin for publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
bartvl-xenit authored and todorinskiz committed Oct 12, 2023
1 parent 24cd4b4 commit 43aa5b8
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 47 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,8 @@ jobs:
java-version: 11
- name: Publish
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
arguments: publish -PsigningKeyId=CDE3528F
ORG_GRADLE_PROJECT_publish_username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_publish_password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
SIGNING_PRIVATE_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}
SIGNING_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
run: ./gradlew publish --info
1 change: 1 addition & 0 deletions alfred-telemetry-platform/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'idea'
id 'java'
id 'maven-publish'
id 'eu.xenit.alfresco' version "1.1.0"
id 'eu.xenit.amp' version "1.1.0"
}
Expand Down
1 change: 1 addition & 0 deletions alfred-telemetry-solr/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
id 'maven-publish'
id 'eu.xenit.alfresco' version '1.1.0' apply false
id 'base'
id 'idea'
Expand Down
78 changes: 39 additions & 39 deletions publish.gradle
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'
pluginManager.withPlugin('maven-publish') {
apply plugin: 'signing'

publishing {
publications {
all {
pom {
url = 'https://github.com/xenit-eu/alfred-telemetry'
name = "alfred-telemetry"
description = project.description
publishing {

scm {
connection = 'scm:git:[email protected]:xenit-eu/alfred-telemetry.git'
developerConnection = 'scm:git:[email protected]:xenit-eu/alfred-telemetry.git'
url = 'https://github.com/xenit-eu/alfred-telemetry.git'
}
developers {
developer {
id = "xenit"
name = "Xenit Solutions NV"
repositories {
if ("${project.version}".endsWith('-SNAPSHOT')) {
sonatypeSnapshots {
credentials {
username = project.findProperty('publish_username')
password = project.findProperty('publish_password')
}
}

licenses {
license {
name = 'GNU Lesser General Public License v3.0'
url = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
} else {
sonatypeMavenCentral {
credentials {
username = project.findProperty('publish_username')
password = project.findProperty('publish_password')
}
}
}
}
}
publications {
all {
pom {
url = 'https://github.com/xenit-eu/alfred-telemetry'
name = "alfred-telemetry"
description = project.description

repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.toString().endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
scm {
connection = 'scm:git:[email protected]:xenit-eu/alfred-telemetry.git'
developerConnection = 'scm:git:[email protected]:xenit-eu/alfred-telemetry.git'
url = 'https://github.com/xenit-eu/alfred-telemetry.git'
}
developers {
developer {
id = "xenit"
name = "Xenit Solutions NV"
}
}

credentials {
username = project.findProperty('sonatype_username')
password = project.findProperty('sonatype_password')
licenses {
license {
name = 'GNU Lesser General Public License v3.0'
url = 'https://www.gnu.org/licenses/lgpl-3.0.txt'
}
}
}
}
}
}
}

signing {
required { !version.toString().endsWith("SNAPSHOT") }
useInMemoryPgpKeys(findProperty("signingKeyId"), findProperty("signingKey"), findProperty("signingPassword"))
sign publishing.publications
}
}
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
plugins {
id 'eu.xenit.enterprise-conventions.oss' version '0.2.0'
}
rootProject.name = 'alfred-telemetry'

// Alfred Telemetry core module
Expand Down

0 comments on commit 43aa5b8

Please sign in to comment.