Skip to content

Commit

Permalink
Fix cache handling in Maven publish workflow
Browse files Browse the repository at this point in the history
If this works, shit is not cache (like I stated in f7f3318) but me.

[skip travis]
  • Loading branch information
bissim committed Aug 14, 2020
1 parent d53342b commit f16adff
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# the first job will build project artifacts
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -45,12 +45,22 @@ jobs:
# the second job will deploy artifacts over GitHub Packages
ghp-deploy:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

needs: build

steps:
- uses: actions/checkout@v2
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.m2/repository
${{ github.workspace }}/java
key: ${{ runner.os }}-maven-${{ hashFiles('${{ github.workspace }}/java/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('${{ github.workspace }}/java/pom.xml') }}
${{ runner.os }}-maven-
${{ runner.os }}-
- name: Set up GitHub Packages
uses: actions/setup-java@v1
Expand All @@ -72,12 +82,22 @@ jobs:
# the third job will deploy srtifacts over Nexus
oss-deploy:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

needs: build

steps:
- uses: actions/checkout@v2
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.m2/repository
${{ github.workspace }}/java
key: ${{ runner.os }}-maven-${{ hashFiles('${{ github.workspace }}/java/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('${{ github.workspace }}/java/pom.xml') }}
${{ runner.os }}-maven-
${{ runner.os }}-
- name: Set up Apache Maven Central
uses: actions/setup-java@v1
Expand All @@ -99,12 +119,27 @@ jobs:
# the fourth job will release artifacts over GitHub
release:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

needs: build

steps:
- uses: actions/checkout@v2
- name: Set up cache
uses: actions/cache@v2
with:
path: |
~/.m2/repository
${{ github.workspace }}/java
key: ${{ runner.os }}-maven-${{ hashFiles('${{ github.workspace }}/java/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('${{ github.workspace }}/java/pom.xml') }}
${{ runner.os }}-maven-
${{ runner.os }}-
- name: Set up Java ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}

- name: Build artifacts
run: mvn -B -T $(nproc) package -f $WS/java/pom.xml
Expand Down

0 comments on commit f16adff

Please sign in to comment.