Better Testing #3
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 will build the repo and upload the package as an artifact | |
name: Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [ '8', '11', '17' ] # LTS versions | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
working-directory: ./ | |
run: mvn -B package --file pom.xml | |
- name: Extract Maven project version | |
working-directory: ./ | |
run: echo "lib_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV | |
id: project | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.java == '8' }} | |
with: | |
name: Vortex-IO-${{ env.lib_version }}-SNAPSHOT | |
path: target/Vortex-IO-${{ env.lib_version }}.jar | |
retention-days: 90 |