From af4f4482107f49b256da358c735d678c2d85ae51 Mon Sep 17 00:00:00 2001 From: Martin Reinhardt Date: Thu, 3 Oct 2024 09:47:47 +0200 Subject: [PATCH] feat: Adding maven central deployment --- .github/workflows/release.yml | 6 +- pom.xml | 163 ++++++++++++++++++++++------------ 2 files changed, 111 insertions(+), 58 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04edb3cf..96a80b15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,6 +56,8 @@ jobs: distribution: "temurin" # As good as any other, see: https://github.com/actions/setup-java#supported-distributions java-package: "jdk" java-version: "21" + gpg-private-key: ${{ secrets.OSS_SONATYPE_GPG_PRIVATE_KEY }} # Value of the GPG private key to import + gpg-passphrase: ${{ secrets.OSS_SONATYPE_GPG_PASSPHRASE }} # env variable for GPG private key passphrase check-latest: true cache: "maven" @@ -67,7 +69,7 @@ jobs: [{ "id": "central", "username": "${{ secrets.OSS_SONATYPE_USER }}", - "password": "${{ secrets.OSS_SONATYPE_USER }}" + "password": "${{ secrets.OSS_SONATYPE_PASS }}" },{ "id":"github", "username": "ci-bot", @@ -79,7 +81,7 @@ jobs: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} run: | export TZ="Europe/Berlin" - mvn release:prepare release:perform -B -DreleaseVersion=${{ inputs.releaseversion }} -DskipITs=true -Darguments="-DskipTests=true -DskipITs=true" + mvn release:prepare release:perform -B -Pcentral-publish -DreleaseVersion=${{ inputs.releaseversion }} -DskipITs=true -Darguments="-DskipTests=true -DskipITs=true" # write version info cat <target/config.json { diff --git a/pom.xml b/pom.xml index dc4fa774..20363e84 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 net.continuous-security-tools @@ -40,13 +41,14 @@ - - github - GitHub Packages - https://maven.pkg.github.com/ContinuousSecurityTooling/keycloak-auditor - + + github + GitHub Packages + https://maven.pkg.github.com/ContinuousSecurityTooling/keycloak-auditor + + https://github.com/ContinuousSecurityTooling/keycloak-auditor/issues GitHub Issues @@ -63,7 +65,7 @@ UTF-8 UTF-8 UTF-8 - + 17 @@ -72,7 +74,7 @@ https://sonarcloud.io - ${project.basedir}/../spi/target/site/jacoco/jacoco.xml + ${project.basedir}/../spi/target/site/jacoco/jacoco.xml @@ -109,6 +111,8 @@ 2.10.4 1.21.0 3.2.1263 + 3.2.7 + 1.7.0 @@ -194,10 +198,10 @@ test - org.mockito - mockito-junit-jupiter - ${mockito.version} - test + org.mockito + mockito-junit-jupiter + ${mockito.version} + test org.hamcrest @@ -238,14 +242,14 @@ mockito-core - org.mockito - mockito-junit-jupiter + org.mockito + mockito-junit-jupiter - org.junit-pioneer - junit-pioneer - 2.2.0 - test + org.junit-pioneer + junit-pioneer + 2.2.0 + test @@ -270,7 +274,8 @@ 1 false - @{surefire.argLine} --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED + @{surefire.argLine} --add-opens java.base/java.util=ALL-UNNAMED --add-opens + java.base/java.lang=ALL-UNNAMED @@ -298,9 +303,9 @@ true - + - + @@ -310,43 +315,89 @@ versions-maven-plugin ${maven-versions-plugin.version} - - - org.jacoco - jacoco-maven-plugin - ${jacoco.version} - - - - prepare-agent - - - surefire.argLine - - - - - report - test - - report - - - ${project.reporting.outputDirectory}/jacoco - - - - - + - maven-release-plugin - 3.1.1 - - v@{project.version} - + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + surefire.argLine + + + + + report + test + + report + + + ${project.reporting.outputDirectory}/jacoco + + + - - + + + + central-publish + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + maven-release-plugin + 3.1.1 + + v@{project.version} + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + verify + + sign + + + bc + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus-staging-maven-plugin.version} + true + + ossrh + https://oss.sonatype.org/ + true + + + + + +