Test Deployment #2
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
name: Test Deployment | |
on: | |
workflow_dispatch: | |
env: | |
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} | |
jobs: | |
publish-maven: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: # running setup-java overwrites the settings.xml | |
distribution: 'temurin' | |
java-version: '17' | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once | |
- name: Publish to GitHub Packages | |
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github::https://maven.pkg.github.com/${{ github.repository }} | |
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: # running setup-java again overwrites the settings.xml | |
distribution: 'temurin' | |
java-version: '17' | |
server-id: sonatype-central-portal | |
server-username: MAVEN_CENTRAL_USERNAME | |
server-password: MAVEN_CENTRAL_TOKEN | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Publish to Central Portal | |
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests | |
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} | |
env: | |
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |