Skip to content

Deploy to Maven

Deploy to Maven #18

Workflow file for this run

name: Deploy to Maven
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Set up JDK 11
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Maven
run: mvn -B package
- name: Generate sbom output
run: mvn org.cyclonedx:cyclonedx-maven-plugin:makeBom && mv ./duo-client/target/cyclonedx-sbom.json ./cyclonedx-sbom.json
- name: Convert SBOM
uses: duosecurity/duo_client_python/.github/actions/sbom-convert@master
- name: Archive SBOM artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: duo_client_java_sbom
path: spdx.json
- name: Set up Apache Maven Central
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
with:
java-version: '11'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Apache Maven Central
run: mvn -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} -P release deploy
working-directory: ./duo-client
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}