Workflow file for this run
This file contains hidden or 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: | |
| release: | |
| types: [created] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Maven Central Repository | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| - name: Import GPG key | |
| run: | | |
| echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --yes --import | |
| echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf | |
| echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf | |
| gpgconf --kill gpg-agent | |
| gpgconf --launch gpg-agent | |
| - name: Set GPG_TTY | |
| run: | | |
| export GPG_TTY=$(tty) | |
| echo "GPG_TTY=$GPG_TTY" >> $GITHUB_ENV | |
| - name: Publish package | |
| run: mvn --batch-mode -Prelease deploy -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} -X | |
| env: | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| - name: Upload JAR to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: target/use-caseinator-*.jar | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} |