From 50650a44e0d403cff234b22e43fe4b8b393732d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Couralet?= Date: Wed, 3 Feb 2021 13:01:43 +0100 Subject: [PATCH] Cache management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédric Couralet --- .github/workflows/release.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2c6af07..c5194c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,20 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 - name: Build project # This would actually build your project, using zip for an example artifact run: | - mvn versions:set -DnewVersion=${{ github.ref }} - mvn package + mvn -B versions:set -DnewVersion=${{ github.ref }} + mvn -B package - name: Create Release id: create_release uses: actions/create-release@v1 @@ -35,5 +45,5 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: target/keycloak-mail-whitelisting-${{ github.ref }}.jar - asset_name: keycloak-mail-whitelisting-${{ github.ref }}.zip + asset_name: keycloak-mail-whitelisting-${{ github.ref }}.jar asset_content_type: application/jar