Skip to content

Commit cec0e8f

Browse files
committed
fix: github actions caching is now calculated based on dependencies block instead of the whole pom.xml
1 parent 51b011f commit cec0e8f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,20 @@ jobs:
3838
with:
3939
distribution: 'temurin'
4040
java-version: '21'
41-
cache: 'maven'
41+
42+
- name: Extract dependencies block and hash it
43+
id: hash
44+
run: |
45+
awk '/<dependencies>/,/<\/dependencies>/' pom.xml > pom.dependencies.xml
46+
echo "hash=$(sha256sum pom.dependencies.xml | cut -d " " -f1)" >> $GITHUB_OUTPUT
47+
48+
- name: Cache Maven repo
49+
uses: actions/cache@v4
50+
with:
51+
path: ~/.m2/repository
52+
key: maven-${{ runner.os }}-${{ steps.hash.outputs.hash }}
53+
restore-keys: |
54+
maven-${{ runner.os }}-
4255
4356
- name: Build with Maven
4457
run: mvn -B package

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.github.justadeni</groupId>
88
<artifactId>multiproxyplayercount</artifactId>
9-
<version>0.1.3</version>
9+
<version>0.1.4</version>
1010
<packaging>jar</packaging>
1111

1212
<name>MultiProxyPlayerCount</name>

0 commit comments

Comments
 (0)