Build and Deploy Github Package for master #21
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 builds develop and deploys a snapshot to our repository. | |
# Will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
name: Build and Deploy Github Package | |
run-name: Build and Deploy Github Package for ${{ github.ref_name }} | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MVNCMD: mvn -B -ntp | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_ACTOR: ${{ github.actor }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Dump event context for debugging | |
continue-on-error: true # Debugging output only, and this annoyingly fails when the commit messge has a ( | |
run: | | |
echo '${{ github.event_name }} for ${{ github.ref_type }} ${{ github.ref_name }} or ${{ github.event.ref }}' | |
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push | |
echo 'github.event:' | |
echo '${{ toJSON(github.event) }}' | |
- name: Dump github context | |
continue-on-error: true # Debugging output only, and this annoyingly fails when the commit message has a ( | |
run: | | |
echo '${{ toJSON(github) }}' | |
- name: Git & Maven Status | |
run: | | |
git status --untracked-files --ignored | |
git log -3 --no-color | |
$MVNCMD -version | |
find . -name 'settings*xml' | |
find /home/runner/work/ -name 'settings*xml' | |
- name: Mvn Effective POM | |
run: $MVNCMD -N help:effective-pom | |
- name: Mvn Effective Settings | |
run: $MVNCMD -N help:effective-settings | |
- name: Build with Maven | |
# When parent-2:1.7 is active, -P ensureSnapshots will do a sanity check of the version number | |
run: $MVNCMD install | |
- name: Deploy with Maven | |
run: mvn -B deploy |