From a3aa643df28bd30252bea8721eab2f12d2ac66b1 Mon Sep 17 00:00:00 2001 From: bischoffz Date: Fri, 29 Mar 2024 19:40:15 -0400 Subject: [PATCH] test deploy to maven central --- .github/workflows/release_build.yml | 22 +++- .github/workflows/release_pr_build.yml | 2 +- pom.xml | 156 ++++++++++++++++--------- 3 files changed, 119 insertions(+), 61 deletions(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 7f2f5dc..5c160bb 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -15,7 +15,7 @@ on: branches: ["main"] jobs: - create-release: + build-deploy: runs-on: ubuntu-latest permissions: contents: write @@ -28,9 +28,18 @@ jobs: with: java-version: '17' distribution: 'temurin' - - - name: Build Util - run: mvn clean install -Prelease --file pom.xml + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Build and Deploy Util + run: mvn clean deploy -Pjavadoc,sign --file pom.xml + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSWORD }} - name: Get Util Version run: | @@ -39,9 +48,10 @@ jobs: - name: Make Util Release uses: ncipollo/release-action@v1.13.0 with: - artifacts: "target/util-${{ env.version }}*.jar" - prerelease: ${{ endsWith(env.version, 'SNAPSHOT') || contains(env.version, '-RC') }} + artifacts: "target/util-${{ env.version }}*" name: "v${{ env.version }}" tag: "v${{ env.version }}" generateReleaseNotes: true skipIfReleaseExists: true + + diff --git a/.github/workflows/release_pr_build.yml b/.github/workflows/release_pr_build.yml index 63bb22f..07b3f9f 100644 --- a/.github/workflows/release_pr_build.yml +++ b/.github/workflows/release_pr_build.yml @@ -26,7 +26,7 @@ jobs: distribution: 'temurin' - name: Build Util - run: mvn clean install --file pom.xml + run: mvn clean install -Pjavadoc,jacoco --file pom.xml # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive # - name: Update dependency graph diff --git a/pom.xml b/pom.xml index ff0bf21..dc03316 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ gov.hhs.aspr.ms util 4.1.1 - jar + jar Modeling Utils A suite of utility methods that are useful for simulation frameworks. @@ -20,6 +20,10 @@ GNU GENERAL PUBLIC LICENSE v3 https://www.gnu.org/licenses/gpl-3.0.en.html + + Vulnerability Disclosure Policy + https://www.hhs.gov/vulnerability-disclosure-policy/index.html + @@ -51,11 +55,14 @@ UTF-8 17 17 + + false 3.2.5 3.3.0 3.6.3 + 3.2.2 3.6.1 @@ -111,57 +118,6 @@ - - - org.jacoco - jacoco-maven-plugin - ${jacoco-maven-plugin.version} - - - default-prepare-agent - - prepare-agent - - - - default-report - - report - - - - default-check - - check - - - - - BUNDLE - - - LINE - COVEREDRATIO - 0.0 - - - BRANCH - COVEREDRATIO - 0.0 - - - INSTRUCTION - COVEREDRATIO - 0.0 - - - - - - - - - org.apache.maven.plugins @@ -177,12 +133,23 @@ + + + org.sonatype.central + central-publishing-maven-plugin + 0.4.0 + true + + central + true + + - release + javadoc @@ -213,6 +180,87 @@ + + sign + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + verify + + sign + + + + + false + + + + + + + jacoco + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + default-prepare-agent + + prepare-agent + + + + default-report + + report + + + + default-check + + check + + + + + BUNDLE + + + LINE + COVEREDRATIO + 0.0 + + + BRANCH + COVEREDRATIO + 0.0 + + + INSTRUCTION + COVEREDRATIO + 0.0 + + + + + + + + + + + - + \ No newline at end of file