From 53160e8ab5ee9c8cf568e834206aa84832821499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=CE=B1x?= <34509813+Mw3y@users.noreply.github.com> Date: Wed, 10 Jan 2024 17:20:14 +0100 Subject: [PATCH] Update maven.yml --- .github/workflows/maven.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c377255..2db588a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -18,16 +18,29 @@ jobs: build: runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + + - name: Cache the Maven packages to speed up build + uses: actions/cache@v1 with: - java-version: '17' - distribution: 'temurin' - - run: mvn --batch-mode --update-snapshots verify - - run: mkdir staging && cp target/*.jar staging - - uses: actions/upload-artifact@v3 + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build and test project with Maven + run: mvn -B package --file pom.xml + + - name: Create staging directory and copy jars + run: mkdir staging && cp target/*jar-with-dependencies.jar staging + + - name: Package application + uses: actions/upload-artifact@v1 with: name: PokeMAN path: staging