From 7c4f98c42c5d1ee27d6ce73c9bd0e4e5e3f4aea2 Mon Sep 17 00:00:00 2001 From: "John J. Aylward" Date: Mon, 16 Oct 2023 17:30:57 -0400 Subject: [PATCH] Add new deployment pipeline. This should only trigger when a release is published --- .github/workflows/deployment.yml | 40 ++++++++++++++++++++++++++++++++ pom.xml | 7 ++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/deployment.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..d69b478 --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,40 @@ +# For more information see: https://docs.github.com/en/actions/learn-github-actions or https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions + +name: Deployment workflow + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - name: Set up Java for publishing to Maven Central Repository + uses: actions/setup-java@v3 + with: + # Use lowest supported LTS Java version + java-version: '8' + distribution: 'temurin' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish to the Maven Central Repository + run: mvn --batch-mode deploy + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + # - name: Set up Java for publishing to GitHub Packages + # uses: actions/setup-java@v3 + # with: + # # Use lowest supported LTS Java version + # java-version: '8' + # distribution: 'temurin' + # - name: Publish to GitHub Packages + # run: mvn --batch-mode deploy + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pom.xml b/pom.xml index 77bbdac..fb983f0 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,13 @@ UTF-8 + + + ossrh + Central Repository OSSRH + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + +