Deploy to Maven #10
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
name: Deploy to Maven | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 1.8 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- 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@v3 | |
with: | |
name: duo_client_java_sbom | |
path: spdx.json | |
- name: Set up Apache Maven Central | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
server-id: ossrh | |
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 }} |