v0.0.4 #5
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
# This workflow will build a package using Maven and then publish it to Maven Central 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: Publish to Maven | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml | |
settings-path: ${{ github.workspace }} # location for the settings.xml file | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Generate Javadoc | |
run: mvn -B javadoc:javadoc --file pom.xml | |
- name: Remove with-dependencies | |
run: rm -f target/*with-dependencies.jar | |
publish: | |
runs-on: ubuntu-latest | |
environment: | |
name: MVN_DEPLOY | |
steps: | |
- id: install-secret-key | |
name: Install gpg secret key | |
run: | | |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import | |
gpg --list-secret-keys --keyid-format LONG | |
- id: install-pulic-key | |
name: Install gpg public key | |
run: | | |
cat <(echo -e "${{ secrets.OSSRH_GPG_PUBLIC_KEY }}") | gpg --batch --import | |
gpg --list-public-keys --keyid-format LONG | |
- uses: actions/checkout@v2 | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
- name: Publish package | |
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} clean deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} |