Skip to content

Extract params from BatchRunner #124

Extract params from BatchRunner

Extract params from BatchRunner #124

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}
- name: Append 'SNAPSHOT' to version if 'push' happened on 'main'
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
mvn help:evaluate -N -Dexpression=project.version|grep -v '\['
VERSION=$(mvn help:evaluate -N -Dexpression=project.version|grep -v '\[')
mvn versions:set -DnewVersion=$VERSION-SNAPSHOT
- name: Append branch name to version if 'push' did not happen on 'main' or a tag
if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')}}
run: |
mvn help:evaluate -N -Dexpression=project.version|grep -v '\['
VERSION=$(mvn help:evaluate -N -Dexpression=project.version|grep -v '\[')
mvn versions:set -DnewVersion=$VERSION-${GITHUB_REF##*/}
- name: Package with Maven
run: mvn -B package --file pom.xml
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: jars
retention-days: 2
path: |
target/*.jar
!target/*-with-dependencies.jar