V 1.0.0-5 #17
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
| # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | |
| # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | |
| name: Maven Package | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| gpg-private-key: '' # explicitly disable automatic import | |
| - name: Import GPG key | |
| run: | | |
| echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import | |
| env: | |
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| - name: Publish to Maven Central | |
| run: mvn deploy -P release | |
| env: | |
| OSSRH_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
| OSSRH_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Upload JAR to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: target/use-caseinator-*.jar | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |