From f8f7822cbbd54908aac24b4fb3cdde19bec75ab7 Mon Sep 17 00:00:00 2001 From: Matthew Khouzam Date: Mon, 11 Mar 2024 11:02:27 -0400 Subject: [PATCH] Setup private key in gihub action Signed-off-by: Matthew Khouzam --- .github/workflows/maven-publish.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 42b0587..3cd9b60 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -16,6 +16,28 @@ jobs: packages: write steps: + - id: install-secret-key + name: Install gpg secret key + run: | + cat <(echo -e "${{ secrets.ORG_GPG_PRIVATE_KEY }}") | gpg --batch --import + gpg --list-secret-keys --keyid-format LONG + - uses: actions/checkout@v4 + - name: Set up Java for publishing to Maven Central Snapshot Repository + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: 'maven' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-passphrase: PASSPHRASE + - name: Make a snapshot + run: mvn -Pdeploy -Pproduction --no-transfer-progress --batch-mode clean deploy -U + env: + MAVEN_USERNAME: ${{ secrets.ORG_OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }} + PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v4