-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (54 loc) · 1.76 KB
/
cache-refresh.yml
File metadata and controls
55 lines (54 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Cache Refresh
on:
schedule:
- cron: '0 2 */5 * *'
workflow_dispatch:
permissions:
contents: read
jobs:
Get-Versions:
runs-on: ubuntu-24.04
outputs:
versions: ${{ steps.Get_Versions.outputs.versions }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get Minecraft versions
id: Get_Versions
run: |
VERSIONS=$(find versions -maxdepth 1 -type d -name "[0-9]*.[0-9]*" | xargs -I {} basename {} | sort -V | jq -R . | jq -s -c .)
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
Refresh-Matrix:
runs-on: ubuntu-24.04
needs: Get-Versions
strategy:
matrix:
minecraft_version: ${{ fromJson(needs.Get-Versions.outputs.versions) }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ matrix.minecraft_version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-${{ matrix.minecraft_version }}-
${{ runner.os }}-gradle-
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Refresh cache for ${{ matrix.minecraft_version }}
run: ./gradlew :${{ matrix.minecraft_version }}:dependencies
- name: Stop Gradle daemon
run: ./gradlew --stop