Import GPG key #73
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 is a basic workflow to help you get started with Actions | |
name: Java CI with Maven | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 for deploy to Sonatype | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
server-id: central | |
server-username: ${{ secrets.MAVEN_USERNAME }} | |
server-password: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} | |
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Verify with Maven | |
if: github.event_name == 'pull_request' | |
run: mvn -B clean verify | |
- name: Verify javadoc | |
if: github.event_name == 'pull_request' | |
run: mvn -B -Prelease javadoc:test-javadoc | |
- name: Compile | |
run: mvn -B -Prelease compile | |
- name: Javadoc | |
run: mvn -B -Prelease javadoc:jar | |
- name: Source | |
run: mvn -B -Prelease source:jar | |
- name: Prepare Maven environnement with Java 17 for deployment to Sonatype | |
run: export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED" | |
- name: Import GPG Key | |
uses: crazy-max/ghaction-import-gpg@v1 | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Publish to Sonatype Central | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
run: mvn -B -PsonatypeDeploy deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
MAVEN_GPG_KEY: ${{ secrets.GPG_SIGNING_KEY }} |