v1.0-DEV.10 #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish package to the Maven Central Repository | |
on: | |
# push: | |
# branches: [ v0.9-DEV ] | |
release: | |
types: [published] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Install gpg key and publish package | |
run: | | |
echo -e "Releasing ${{ github.ref_name }}" | |
echo -e "$(tty)" | |
gpg --version | |
mvn -version | |
# This avoids gpg: signing failed: Inappropriate ioctl for device error | |
# See https://github.com/keybase/keybase-issues/issues/2798 | |
export GPG_TTY=$(tty) | |
# export GPG_TTY=`tty` | |
# https://gist.github.com/sualeh/ae78dc16123899d7942bc38baba5203c | |
echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | gpg --batch --import | |
gpg --list-secret-keys --keyid-format LONG | |
# mvn --batch-mode deploy -Drevision=${{ github.ref_name }} -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -DperformRelease=true | |
mvn --batch-mode clean deploy -Drevision=${{ github.ref_name }} -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -DperformRelease=true | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} |