diff --git a/.github/workflows/publish-maven-plugin.yml b/.github/workflows/publish-maven-plugin.yml index 79ac63f..9ce8302 100644 --- a/.github/workflows/publish-maven-plugin.yml +++ b/.github/workflows/publish-maven-plugin.yml @@ -58,16 +58,6 @@ jobs: env: CONTRAST_GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - - - - name: Maven Release (dry-run) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - run: | - cd maven-plugin/ && ./mvnw -DdryRun=true --batch-mode release:prepare release:perform -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN - - name: Maven Release env: @@ -76,7 +66,7 @@ jobs: OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: | - cd maven-plugin/ && ./mvnw --settings release-settings.xml --batch-mode release:prepare release:perform -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN + cd maven-plugin/ && ./mvnw --settings release-settings.xml deploy -Prelease # Remove gpg keys so they're never reused between runs without being reimported - name: Cleanup GPG Key diff --git a/.github/workflows/publish-sdk.yml b/.github/workflows/publish-sdk.yml index 20805e9..a482d63 100644 --- a/.github/workflows/publish-sdk.yml +++ b/.github/workflows/publish-sdk.yml @@ -60,15 +60,6 @@ jobs: MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - - name: Maven Release (dry-run) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - run: | - cd sdk/ && ./mvnw -DdryRun=true --batch-mode release:prepare release:perform -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN - - - name: Maven Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -76,7 +67,7 @@ jobs: OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: | - cd sdk/ && ./mvnw --settings release-settings.xml --batch-mode release:prepare release:perform -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN + cd sdk/ && ./mvnw --settings release-settings.xml deploy -Prelease # Remove gpg keys so they're never reused between runs without being reimported - name: Cleanup GPG Key diff --git a/maven-plugin/README.md b/maven-plugin/README.md index ad982ba..dd4e49a 100644 --- a/maven-plugin/README.md +++ b/maven-plugin/README.md @@ -69,3 +69,10 @@ this: ```shell source unset-contrast.env ``` + +### Releasing +Releases are done via Sonatype's Central Release Plugin to Maven Central. +* Update the version in `pom.xml` to the desired release version. +* Run the release action in github off of the main branch (or other branch in dropdown) +* Log in to Sonatype to approve release. +* Tag the release in git: eg `git tag -a contrast-maven-plugin-1.2.3` and `git push --tags` diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 782f5fe..e93cc71 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -4,7 +4,7 @@ com.contrastsecurity contrast-maven-plugin - 2.13.4-SNAPSHOT + 2.13.4 maven-plugin Contrast Maven Plugin @@ -35,18 +35,10 @@ - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - ossrh + central https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - github - scm:git:https://github.com/Contrast-Security-OSS/contrast-sdk-java.git - @@ -250,24 +242,6 @@ - - maven-release-plugin - - release - - - - maven-deploy-plugin - - - deploy - deploy - - deploy - - - - maven-site-plugin @@ -372,10 +346,6 @@ maven-install-plugin 2.5.2 - - maven-deploy-plugin - 2.8.2 - maven-site-plugin 3.9.1 @@ -388,10 +358,6 @@ maven-project-info-reports-plugin 3.1.2 - - maven-release-plugin - 3.1.1 - maven-scm-plugin 1.11.2 @@ -440,11 +406,6 @@ - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - @@ -670,13 +631,12 @@ - org.sonatype.plugins - nexus-staging-maven-plugin + org.sonatype.central + central-publishing-maven-plugin + 0.9.0 true - ossrh - https://oss.sonatype.org/ - true + central diff --git a/maven-plugin/release-settings.xml b/maven-plugin/release-settings.xml index 87b3084..bdb6656 100644 --- a/maven-plugin/release-settings.xml +++ b/maven-plugin/release-settings.xml @@ -6,7 +6,7 @@ - ossrh + central ${env.OSSRH_USERNAME} ${env.OSSRH_PASSWORD} @@ -14,7 +14,7 @@ - ossrh + central true @@ -26,7 +26,7 @@ - ossrh + central diff --git a/sdk/README.md b/sdk/README.md index 9896e71..0f51275 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -78,3 +78,10 @@ apply the formatting before committing changes using the Maven plugin: ```shell ./mvnw spotless:apply ``` + +### Releasing +Releases are done via Sonatype's Central Release Plugin to Maven Central. +* Update the version in `pom.xml` to the desired release version. +* Run the release action in github off of the main branch (or other branch in dropdown) +* Log in to Sonatype to approve release. +* Tag the release in git: eg `git tag -a contrast-sdk-java-1.2.3` and `git push --tags` diff --git a/sdk/pom.xml b/sdk/pom.xml index 83c4a4e..e48105c 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -4,7 +4,7 @@ com.contrastsecurity contrast-sdk-java - 3.4.4-SNAPSHOT + 3.4.4 Contrast Java SDK Java SDK for using Contrast Security APIs @@ -32,12 +32,8 @@ - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - ossrh + central https://oss.sonatype.org/service/local/staging/deploy/maven2/ @@ -117,30 +113,6 @@ - - org.apache.maven.plugins - maven-enforcer-plugin - - - - enforce - - - - - - - org.apache.maven.plugins:maven-surefire-plugin - org.apache.maven.plugins:maven-failsafe-plugin - org.apache.maven.plugins:maven-surefire-report-plugin - - - - - - - - maven-source-plugin @@ -235,24 +207,6 @@ maven-surefire-plugin - - maven-release-plugin - - release - - - - maven-deploy-plugin - - - deploy - deploy - - deploy - - - - org.codehaus.mojo templating-maven-plugin @@ -272,10 +226,6 @@ maven-clean-plugin 3.1.0 - - maven-enforcer-plugin - 3.0.0 - maven-resources-plugin 3.2.0 @@ -312,18 +262,10 @@ maven-gpg-plugin 3.2.7 - - maven-deploy-plugin - 2.8.2 - maven-scm-plugin 1.11.2 - - maven-release-plugin - 3.1.1 - maven-site-plugin 3.9.1 @@ -370,11 +312,6 @@ templating-maven-plugin 1.0.0 - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - @@ -459,13 +396,12 @@ - org.sonatype.plugins - nexus-staging-maven-plugin + org.sonatype.central + central-publishing-maven-plugin + 0.9.0 true - ossrh - https://oss.sonatype.org/ - true + central diff --git a/sdk/release-settings.xml b/sdk/release-settings.xml index 87b3084..bdb6656 100644 --- a/sdk/release-settings.xml +++ b/sdk/release-settings.xml @@ -6,7 +6,7 @@ - ossrh + central ${env.OSSRH_USERNAME} ${env.OSSRH_PASSWORD} @@ -14,7 +14,7 @@ - ossrh + central true @@ -26,7 +26,7 @@ - ossrh + central