From 9f479c6d946147b0c5f76db1a3b770bc97076ec6 Mon Sep 17 00:00:00 2001 From: Michael Gardner Date: Tue, 5 Mar 2024 15:23:11 -0500 Subject: [PATCH] HPCC4J-548 Deployment to jfrog artifactory Signed-off-by: Michael Gardner --- .../workflows/publish-release-on-merge.yml | 31 +++++++- .../workflows/publish-snapshots-on-merge.yml | 31 +++++++- pom.xml | 75 +++++++++++++++++++ 3 files changed, 130 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-release-on-merge.yml b/.github/workflows/publish-release-on-merge.yml index d1e2893a2..8e203d1d7 100644 --- a/.github/workflows/publish-release-on-merge.yml +++ b/.github/workflows/publish-release-on-merge.yml @@ -4,12 +4,12 @@ on: tags: - '*-release' jobs: - publish: + publish-maven-central: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Maven Central Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'adopt' @@ -23,4 +23,27 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.OSSRH_USER_NAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASS }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGN_MODULES_PASSPHRASE }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.SIGN_MODULES_PASSPHRASE }} + publish-jfrog-artifactory: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Jfrog Artifactory Deployment + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'adopt' + server-id: 'jfrog' + server-username: JFROG_USER + server-password: JFROG_TOKEN + gpg-private-key: ${{ secrets.SIGNING_SECRET }} + gpg-passphrase: JFROG_GPG_PASSPHRASE + - name: Publish package + run: mvn -Pjfrog-artifactory -Dgpg.passphrase=${{ secrets.SIGN_MODULES_PASSPHRASE }} -DstagingProgressTimeoutMinutes=20 clean deploy -e + env: + JFROG_USER: ${{ secrets.JFROG_USER }} + JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }} + JFROG_GPG_PASSPHRASE: ${{ secrets.SIGN_MODULES_PASSPHRASE }} + JFROG_URL: ${{ secrets.JFROG_URL }} + JFROG_SNAPSHOT_REPOSITORY: ${{ secrets.JFROG_SNAPSHOT_REPOSITORY }} + JFROG_REPOSITORY: ${{ secrets.JFROG_REPOSITORY }} diff --git a/.github/workflows/publish-snapshots-on-merge.yml b/.github/workflows/publish-snapshots-on-merge.yml index 0b6018545..5120585ad 100644 --- a/.github/workflows/publish-snapshots-on-merge.yml +++ b/.github/workflows/publish-snapshots-on-merge.yml @@ -7,13 +7,14 @@ on: create: branches: - 'candidate-*' + jobs: - publish: + publish-maven-central: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Maven Central Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'adopt' @@ -26,3 +27,27 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.OSSRH_USER_NAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASS }} + publish-jfrog-artifactory: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Jfrog Artifactory Deployment + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'adopt' + server-id: 'jfrog-snapshot' + server-username: JFROG_USER + server-password: JFROG_TOKEN + gpg-private-key: ${{ secrets.SIGNING_SECRET }} + gpg-passphrase: JFROG_GPG_PASSPHRASE + - name: Publish package + if: contains(github.ref_name, '-release') == false + run: mvn -Pjfrog-artifactory -Dgpg.passphrase=${{ secrets.SIGN_MODULES_PASSPHRASE }} -DstagingProgressTimeoutMinutes=20 clean deploy -e + env: + JFROG_USER: ${{ secrets.JFROG_USER }} + JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }} + JFROG_GPG_PASSPHRASE: ${{ secrets.SIGN_MODULES_PASSPHRASE }} + JFROG_URL: ${{ secrets.JFROG_URL }} + JFROG_SNAPSHOT_REPOSITORY: ${{ secrets.JFROG_SNAPSHOT_REPOSITORY }} + JFROG_REPOSITORY: ${{ secrets.JFROG_REPOSITORY }} diff --git a/pom.xml b/pom.xml index f3c9818b4..d84d32e7d 100644 --- a/pom.xml +++ b/pom.xml @@ -492,6 +492,81 @@ + + jfrog-artifactory + + false + org.hpccsystems.commons.annotations.BaseTests + + + + + jfrog + ${env.JFROG_URL}/artifactory/${env.JFROG_REPOSITORY} + + + jfrog-snapshot + ${env.JFROG_URL}/artifactory/${env.JFROG_SNAPSHOT_REPOSITORY} + + + + + jfrog + hpccpl-maven-virtual + + false + + ${env.JFROG_URL}/artifactory/${env.JFROG_REPOSITORY} + + + snapshots + hccpl-maven-snapshot-virtual + + true + + ${env.JFROG_URL}/artifactory/${env.JFROG_SNAPSHOT_REPOSITORY} + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven.javadoc.version} + + ${javadoc.excludePackageNames} + + + + org.apache.maven.plugins + maven-source-plugin + ${maven.source.version} + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven.gpg.version} + + true + + --batch + --pinentry-mode + loopback + + ${maven.gpg.skip} + + + + maven-surefire-plugin + ${maven.surefire.version} + + ${argLine} + ${groups} + + + + +