Maven Build for Release #151
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
name: Maven Build for Release | |
# Performs a Maven release using JDK 11 when a new GitHub release has been published | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
publish: | |
name: Maven Artifact Publisher (JDK ${{ matrix.java }} with ${{ matrix.build_property }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [ 11 ] | |
build_property: [ "kakadu.version", "ignored.version" ] | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2 | |
- name: Install JDK ${{ matrix.java }} | |
uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1 | |
with: | |
java-version: ${{ matrix.java }} | |
cache: maven | |
- name: Optionally, set artifact qualifier (for private builds that include Kakadu) | |
if: matrix.build_property == 'kakadu.version' | |
run: echo "ARTIFACT_QUALIFIER=${{ secrets.ARTIFACT_QUALIFIER }}" >> $GITHUB_ENV | |
- name: Optionally, login to Docker repository | |
uses: docker/login-action@f3364599c6aa293cdc2b8391b1b56d0c30e45c8a # v1.8.0 | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
if: env.DOCKER_USERNAME != null | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Install Kakadu SSH key | |
uses: webfactory/ssh-agent@ee29fafb6aa450493bac9136b346e51ea60a8b5e # v0.4.1 | |
with: | |
ssh-private-key: ${{ secrets.KAKADU_PRIVATE_SSH_KEY }} | |
- name: Release with Maven (Public) | |
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709 # v1.4.0 | |
if: env.ARTIFACT_QUALIFIER != '-ucla' | |
with: | |
gpg_private_key: ${{ secrets.BUILD_KEY }} | |
gpg_passphrase: ${{ secrets.BUILD_PASSPHRASE }} | |
nexus_username: ${{ secrets.SONATYPE_USERNAME }} # These are placeholders; we're publishing a Docker image | |
nexus_password: ${{ secrets.SONATYPE_PASSWORD }} | |
maven_args: > | |
-Drevision=${{ github.event.release.tag_name }} | |
-ntp -Dorg.slf4j.simpleLogger.log.net.sourceforge.pmd=error | |
-D${{ matrix.build_property }}=${{ secrets.KAKADU_VERSION }} | |
-DskipNexusStagingDeployMojo=true | |
-Ddocker.image=${{ secrets.DOCKER_REGISTRY_ACCOUNT}}cantaloupe${{ env.ARTIFACT_QUALIFIER }}:${{ github.event.release.tag_name }} | |
-Ddocker.registry.username=${{ secrets.DOCKER_USERNAME }} | |
-Ddocker.registry.account=${{ secrets.DOCKER_REGISTRY_ACCOUNT}} | |
-Ddocker.registry.password=${{ secrets.DOCKER_PASSWORD }} | |
# Temporary divergence of our build so we can add some IIIF Auth related patches | |
- name: Release with Maven (UCLA) | |
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709 # v1.4.0 | |
if: env.ARTIFACT_QUALIFIER == '-ucla' | |
with: | |
gpg_private_key: ${{ secrets.BUILD_KEY }} | |
gpg_passphrase: ${{ secrets.BUILD_PASSPHRASE }} | |
nexus_username: ${{ secrets.SONATYPE_USERNAME }} # These are placeholders; we're publishing a Docker image | |
nexus_password: ${{ secrets.SONATYPE_PASSWORD }} | |
maven_args: > | |
-Drevision=${{ github.event.release.tag_name }} | |
-ntp -Dorg.slf4j.simpleLogger.log.net.sourceforge.pmd=error | |
-D${{ matrix.build_property }}=${{ secrets.KAKADU_VERSION }} | |
-DskipNexusStagingDeployMojo=true | |
-Ddocker.image=${{ secrets.DOCKER_REGISTRY_ACCOUNT}}cantaloupe${{ env.ARTIFACT_QUALIFIER }}:${{ github.event.release.tag_name }} | |
-Ddocker.registry.username=${{ secrets.DOCKER_USERNAME }} | |
-Ddocker.registry.account=${{ secrets.DOCKER_REGISTRY_ACCOUNT}} | |
-Ddocker.registry.password=${{ secrets.DOCKER_PASSWORD }} | |
-Dcantaloupe.commit.ref=${{ secrets.DEV_COMMIT_REF }} | |
-Dcantaloupe.apply.patchfiles=${{ secrets.APPLY_PATCHFILES }} | |
-Dcantaloupe.version=dev |