Develop - Build on develop #18
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: Develop - Build | |
run-name: Develop - Build on ${{ github.ref_name }} | |
on: | |
push: | |
branches: [ develop ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MVNCMD: mvn -B -ntp -s .github/settings-istrepo.xml | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: maven | |
# TODO currently maven 3.9.0 creates an error in the maven-minify-plugin , so we use 3.8.7 as workaround | |
- name: Set up Maven | |
uses: stCarolas/setup-maven@v4.5 | |
with: | |
maven-version: 3.8.7 | |
- name: Git & Maven Status | |
run: | | |
git status --untracked-files --ignored | |
git log -3 --no-color | |
mvn -version | |
- 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 -P ensureSnapshots,test -B verify | |
- name: Sanitycheck version before deploying | |
run: | | |
echo "Version: " | |
$MVNCMD help:evaluate -Dexpression=project.version -q -DforceStdout | |
$MVNCMD help:evaluate -Dexpression=project.version -q -DforceStdout | egrep -- '-SNAPSHOT$' > /dev/null || exit 1 | |
# unfortunately, this would require a snapshot parent if just called from the command line, so we cannot use it: :-( | |
# mvn org.apache.maven.plugins:maven-enforcer-plugin:3.0.0:enforce -Drules=requireSnapshotVersion | |
# Currently done with deploy_test.yml, since this is rather rare. | |
# - name: Deploy with Maven | |
# run: $MVNCMD -P develop -B deploy | |
# env: | |
# NEXUS_BUILD_USER: ${{ secrets.NEXUS_BUILD_USER }} | |
# NEXUS_BUILD_PASSWD: ${{ secrets.NEXUS_BUILD_PASSWD }} |