From 92907735fcc5d374f622e8b1fe9fd1e1d1f0dca0 Mon Sep 17 00:00:00 2001 From: Kyle Dodson Date: Sat, 24 Aug 2024 13:26:36 -0700 Subject: [PATCH] Add publish workflow --- .github/workflows/publish-package.yml | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/publish-package.yml diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..3d720bc --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,31 @@ +name: Publish Maven Artifact + +on: + release: + types: + - published + +jobs: + build-and-publish: + name: Build and Publish + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install GPG secret key + run: | + cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import + - name: Set up Maven Central Repository + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '8' + - name: Publish package + run: | + mvn \ + --no-transfer-progress \ + --batch-mode \ + -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ + clean deploy -P release-sign-artifacts -e + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}