generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from telekom/feature/mavenPublishing
chore: Introduce maven publishing
- Loading branch information
Showing
10 changed files
with
270 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# SPDX-FileCopyrightText: 2024 Deutsche Telekom AG | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gradle" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SPDX-FileCopyrightText: 2024 Deutsche Telekom AG | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Gradle Build and Test | ||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
gradle: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
docker: | ||
image: docker:25-dind | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Execute Gradle build | ||
run: ./gradlew build | ||
|
||
- name: Add coverage to PR | ||
id: jacoco | ||
uses: madrapps/[email protected] | ||
with: | ||
paths: | | ||
${{ github.workspace }}/**/build/reports/jacoco/**/jacocoTestReport.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
min-coverage-overall: 60 | ||
min-coverage-changed-files: 80 | ||
if: github.event_name == 'pull_request' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# SPDX-FileCopyrightText: 2024 Deutsche Telekom AG | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Gradle Publish | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
gradle: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
docker: | ||
image: docker:25-dind | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Execute Gradle publish | ||
env: | ||
PUBLISH_USERNAME: ${{ secrets.PUBLISH_USERNAME }} | ||
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }} | ||
PUBLISH_GPG_PRIVATE_KEY: ${{ secrets.PUBLISH_GPG_PRIVATE_KEY }} | ||
PUBLISH_GPG_PASSPHRASE: ${{ secrets.PUBLISH_GPG_PASSPHRASE }} | ||
run: ./gradlew -Pversion=${{ github.event.release.name }} publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ hazelcastVersion=4.2.8 | |
|
||
# internal | ||
jsonFilterVersion=1.0.1 | ||
|
||
version=0.0.0-DEVELOPMENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,16 @@ plugins { | |
id 'io.spring.dependency-management' | ||
id 'maven-publish' | ||
id 'jacoco' | ||
id 'signing' | ||
} | ||
|
||
group 'de.telekom.eni' | ||
version "${parentVersion}" | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
dependencyManagement { | ||
|
@@ -73,15 +75,57 @@ dependencies { | |
|
||
publishing { | ||
publications { | ||
mavenPublication(MavenPublication) { | ||
|
||
mavenJava(MavenPublication) { | ||
|
||
from components.java | ||
groupId 'de.telekom.eni' | ||
artifactId 'horizon-core' | ||
version project.version | ||
version = project.properties['version'] | ||
|
||
pom { | ||
name = 'Horizon spring parent core' | ||
description = 'Spring-boot-starter core library for pubsub horizon java components.' | ||
url = 'https://github.com/telekom/pubsub-horizon-spring-parent' | ||
inceptionYear = '2022' | ||
|
||
licenses { | ||
license { | ||
name = 'Apache-2.0' | ||
url = 'https://opensource.org/licenses/Apache-2.0' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'eni-pandora' | ||
name = 'Team Pandora' | ||
email = '[email protected]' | ||
organization = 'Deutsche Telekom IT GmbH' | ||
organizationUrl = 'https://developer.telekom.de/' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com/telekom/pubsub-horizon-spring-parent.git' | ||
developerConnection = 'scm:git:git://github.com/telekom/pubsub-horizon-spring-parent.git' | ||
url = 'https://github.com/telekom/pubsub-horizon-spring-parent' | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "OSSRH" | ||
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
credentials { | ||
username = System.getenv('PUBLISH_USERNAME') | ||
password = System.getenv('PUBLISH_PASSWORD') | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
test { | ||
finalizedBy jacocoTestReport | ||
} | ||
|
@@ -96,4 +140,18 @@ jacocoTestReport { | |
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
signing { | ||
def signingKey = new String(Base64.decoder.decode(System.getenv('PUBLISH_GPG_PRIVATE_KEY') ?: "")) | ||
def signingPassword = System.getenv('PUBLISH_GPG_PASSPHRASE') | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
|
||
sign publishing.publications.mavenJava | ||
} | ||
|
||
javadoc { | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,16 @@ plugins { | |
id 'io.spring.dependency-management' | ||
id 'maven-publish' | ||
id 'jacoco' | ||
id 'signing' | ||
} | ||
|
||
group 'de.telekom.eni' | ||
version "${parentVersion}" | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
dependencyManagement { | ||
|
@@ -46,11 +48,52 @@ dependencies { | |
|
||
publishing { | ||
publications { | ||
mavenPublication(MavenPublication) { | ||
|
||
mavenJava(MavenPublication) { | ||
|
||
from components.java | ||
groupId 'de.telekom.eni' | ||
artifactId 'horizon-spring-boot-autoconfigure' | ||
version project.version | ||
version = project.properties['version'] | ||
|
||
pom { | ||
name = 'Horizon spring parent autoconfigure' | ||
description = 'Spring-boot-starter autoconfiguration library for pubsub horizon java components.' | ||
url = 'https://github.com/telekom/pubsub-horizon-spring-parent' | ||
inceptionYear = '2022' | ||
|
||
licenses { | ||
license { | ||
name = 'Apache-2.0' | ||
url = 'https://opensource.org/licenses/Apache-2.0' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'eni-pandora' | ||
name = 'Team Pandora' | ||
email = '[email protected]' | ||
organization = 'Deutsche Telekom IT GmbH' | ||
organizationUrl = 'https://developer.telekom.de/' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com/telekom/pubsub-horizon-spring-parent.git' | ||
developerConnection = 'scm:git:git://github.com/telekom/pubsub-horizon-spring-parent.git' | ||
url = 'https://github.com/telekom/pubsub-horizon-spring-parent' | ||
} | ||
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "OSSRH" | ||
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
credentials { | ||
username = System.getenv('PUBLISH_USERNAME') | ||
password = System.getenv('PUBLISH_PASSWORD') | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -66,3 +109,17 @@ jacocoTestReport { | |
html.required = true | ||
} | ||
} | ||
|
||
signing { | ||
def signingKey = new String(Base64.decoder.decode(System.getenv('PUBLISH_GPG_PRIVATE_KEY') ?: "")) | ||
def signingPassword = System.getenv('PUBLISH_GPG_PASSPHRASE') | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
|
||
sign publishing.publications.mavenJava | ||
} | ||
|
||
javadoc { | ||
if (JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} |
Oops, something went wrong.