Skip to content

test: workflow

test: workflow #46

name: Publishing to Maven Packages
#on: [ push ] # Trigger the workflow when a push (commit) event occurs
on:
push:
branches: [fix/DX-563]
jobs:
publish-maven:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- id: install-secret-key
name: Install gpg secret key
run: |
# Install gpg secret key
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
# Verify gpg secret key
gpg --list-secret-keys --keyid-format LONG
- uses: actions/checkout@v3
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: GPG_PASSPHRASE
- name: Publish to Maven Central Repository
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
# run: mvn --batch-mode deploy