-
-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (77 loc) · 3.31 KB
/
snapshot.yml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Snapshot
concurrency: ci-${{ github.ref }}
on:
workflow_dispatch:
push:
branches:
- 1.*
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Setup Java
run: |
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: fregante/setup-git-user@v2
- uses: actions/cache@v3
with:
path: |
**/.gradle/loom-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- uses: gradle/gradle-build-action@v2
name: Setup Gradle
with:
gradle-home-cache-cleanup: true
gradle-home-cache-includes: |
caches/fabric-loom
gradle-home-cache-excludes: |
caches/build-cache-1
env:
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
- name: Build
id: build
run: |
./gradlew build
env:
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
BUILD_CACHE_URL: ${{ secrets.BUILD_CACHE_URL }}
BUILD_CACHE_USER: ${{ secrets.BUILD_CACHE_USER }}
BUILD_CACHE_PASSWORD: ${{ secrets.BUILD_CACHE_PASSWORD }}
- name: Test - Fabric
if: (success() || failure()) && steps.build.conclusion == 'success'
run: |
./gradlew :fabric:runGametest
env:
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
- name: Test - NeoForge
if: (success() || failure()) && steps.build.conclusion == 'success'
run: |
./gradlew :neoforge:runGametest
env:
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
- name: Move Test Results
run: |
mkdir -p tests/
[[ -f fabric/build/gametest/build/junit.xml ]] && cp fabric/build/gametest/build/junit.xml tests/gametests-fabric.xml || echo "Fabric gametest results not present"
[[ -f neoforge/build/gametest/build/junit.xml ]] && cp neoforge/build/gametest/build/junit.xml tests/gametests-neoforge.xml || echo "NeoForge gametest results not present"
- name: Upload Test Report
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: junit-test-results
path: tests
retention-days: 1
- name: Publish
run: |
./gradlew publish
env:
MAVEN_USER: github
MAVEN_PASSWORD: ${{ secrets.SNAPSHOT_MAVEN_PASSWORD }}
SNAPSHOT_MAVEN_URL: https://maven.lukebemish.dev/snapshots/
BUILD_CACHE_URL: ${{ secrets.BUILD_CACHE_URL }}
BUILD_CACHE_USER: ${{ secrets.BUILD_CACHE_USER }}
BUILD_CACHE_PASSWORD: ${{ secrets.BUILD_CACHE_PASSWORD }}