Skip to content

Commit 3c15c42

Browse files
committed
Do a little hashing
1 parent bf3203c commit 3c15c42

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ jobs:
2020
with:
2121
gradle-home-cache-excludes: |
2222
caches/neoformruntime/assets
23-
- name: Cache Minecraft assets
24-
uses: actions/cache@v4
23+
- name: Restore cached Minecraft assets
24+
uses: actions/cache/restore@v4
2525
with:
2626
path: |
2727
~/.gradle/caches/neoformruntime/assets
28-
key: mc-assets
29-
- name: Test adding a fake asset
30-
run: |
31-
mkdir -p ~/.gradle/caches/neoformruntime/assets/modern_industrialization
32-
echo "This is a test asset" > ~/.gradle/caches/neoformruntime/assets/modern_industrialization/test.txt
28+
restore-keys: mc-assets
29+
# - name: Test adding a fake asset
30+
# run: |
31+
# mkdir -p ~/.gradle/caches/neoformruntime/assets/modern_industrialization
32+
# echo "This is a test asset" > ~/.gradle/caches/neoformruntime/assets/modern_industrialization/test.txt
3333
- name: Build with Gradle
3434
run: ./gradlew build
3535
env:
@@ -42,3 +42,15 @@ jobs:
4242
with:
4343
name: Modern Industrialization ${{ steps.var.outputs.commit_hash }}
4444
path: build/libs
45+
- name: Hash Minecraft assets
46+
id: hash-assets
47+
run: |
48+
find ~/.gradle/caches/neoformruntime/assets -type f -exec sha256sum {} + | sort | sha256sum | cut -d ' ' -f 1 > assets-hash.txt
49+
echo "assets_hash=$(cat assets-hash.txt)" >> $GITHUB_ENV
50+
echo "::set-output name=assets_hash::$(cat assets-hash.txt)"
51+
- name: Cache Minecraft assets
52+
uses: actions/cache/save@v4
53+
with:
54+
path: |
55+
~/.gradle/caches/neoformruntime/assets
56+
key: mc-assets-${{ steps.hash-assets.outputs.assets_hash }}

0 commit comments

Comments
 (0)