From 52900f9762c7663aeab611e6d7919d155e5c375c Mon Sep 17 00:00:00 2001 From: Eugene Platonov Date: Sat, 6 Apr 2024 13:53:12 -0400 Subject: [PATCH] Automatically deploy snapshots to central (attempt 3) --- .github/workflows/snapshot.yml | 11 +++++------ README.md | 12 ++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index fa5b5d81..35f7ce43 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -16,15 +16,14 @@ jobs: distribution: 'temurin' java-version: '17' cache: maven - server-id: central + server-id: central # Value of the distributionManagement/repository/id field of the pom.xml server-username: SONATYPE_USERNAME server-password: SONATYPE_PASSWORD - gpg-private-key: GPG_PRIVATE_KEY - gpg-passphrase: GPG_PASSPHRASE + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # has to be read directly from secrets + gpg-passphrase: MAVEN_GPG_PASSPHRASE # default name used by maven-gpg-plugin - name: Deploy snapshot - run: mvn -ntp clean deploy -P release + run: mvn -Dmaven.test.skip=true -ntp -B clean deploy -P release env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file diff --git a/README.md b/README.md index 3ff0dbcb..90cecc4a 100644 --- a/README.md +++ b/README.md @@ -476,8 +476,10 @@ Go to one of them and run `mvn site`. ## Development -### Manual deployment +### Snapshot deployment +A new snapshot is deployed to sonatype on each commit merged to `main` branch. See [snapshot.yml](.github/workflows/snapshot.yml) workflow for details. +### Manual Release deployment Set sonatype credentials in `~/.m2/settings.xml`: ```xml @@ -492,11 +494,9 @@ Set sonatype credentials in `~/.m2/settings.xml`: ``` -#### Snapshot deployment -To deploy snapshot to sonatype snapshot repo run `mvn clean deploy -P release`. - -#### Release deployment -To deploy release to sonatype release repo run `mvn release:clean release:prepare release:perform -P release`. +To deploy release to sonatype release repo run `mvn release:clean release:prepare release:perform -P release`. +Make sure you have proper pgp keys set up. +This process will be automated in the future. ## License ```