Skip to content

Test publish snapshot #3

Test publish snapshot

Test publish snapshot #3

Workflow file for this run

name: test-snapshot
on:
push:
#workflow_dispatch:
jobs:
release-java:
#if: ${{ false }} # disable for now
runs-on: ubuntu-latest
defaults:
run:
working-directory: java
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v4
#Official documentation seems incomplete. To avoid failure when importing key:
#https://stackoverflow.com/questions/61096521/how-to-use-gpg-key-in-github-actions
#It requires export the private key with the armor option: gpg --output private.pgm --armor --export-secret-key <email>
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v6.0.0
with:
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Set up Apache Maven Central
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '8'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Apache Maven Central
# signing is included only in the specified profile
run: mvn deploy --no-transfer-progress -P publish-maven
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}