diff --git a/.github/workflows/ci-pull-request.yaml b/.github/workflows/ci-pull-request.yaml index 16eb0a76..f9c4f77d 100644 --- a/.github/workflows/ci-pull-request.yaml +++ b/.github/workflows/ci-pull-request.yaml @@ -10,7 +10,7 @@ on: jobs: test: - name: Build/Test + name: Build, Test & Deploy snapshot runs-on: ubuntu-latest @@ -25,6 +25,11 @@ jobs: with: distribution: 'zulu' java-version: ${{ matrix.java_version }} + server-id: ossrh + server-username: ${{ secrets.OSSRH_USERNAME }} # username for Sonatype JIRA login + server-password: ${{ secrets.OSSRH_TOKEN }} # password for Sonatype JIRA login + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Full private key blob + gpg-passphrase: ${{ secrets.SIGN_KEY_PASS }} # Password chosen when creating the GPG key - name: Cache Maven packages uses: actions/cache@v3.3.1 @@ -35,3 +40,15 @@ jobs: - name: Build with Maven run: mvn --batch-mode --update-snapshots verify + + - name: Deploy snapshot + if: ${{ matrix.java_version == 17 }} # No purpose in doing this part multiple times... + run: | + mvn --batch-mode \ + --settings release/m2-settings.xml \ + clean deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + GPG_PASS: ${{ secrets.SIGN_KEY_PASS }} # Password chosen when creating the GPG key +