generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 29
82 lines (82 loc) · 2.47 KB
/
build.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
78
79
80
81
82
name: _step.build
on:
workflow_call:
inputs:
build_publish:
type: boolean
default: false
required: false
build_version_type:
type: string
default: 'DEV'
required: false
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout the sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Validate gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Cache gradle files
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
./.gradle/loom-cache
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/gradle.properties', '**/*.accesswidener', 'settings.json') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build and publish with gradle
if: ${{ inputs.build_publish == true }}
run: |
./gradlew build publish -x test --stacktrace
env:
BUILD_TYPE: ${{ inputs.build_version_type }}
NYAN_MAVEN_PASSWORD: ${{ secrets.NYAN_MAVEN_PASSWORD }}
NYAN_MAVEN_USERNAME: ${{ secrets.NYAN_MAVEN_USERNAME }}
SIGNING_PGP_KEY: ${{ secrets.SIGNING_PGP_KEY }}
- name: Build and publishToMavenLocal with gradle
if: ${{ inputs.build_publish == false }}
run: |
./gradlew build publishToMavenLocal -x test --stacktrace
env:
BUILD_TYPE: ${{ inputs.build_version_type }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
*/**/build/libs/
*/**/build/tmp/submods/
- name: Upload MavenLocal
uses: actions/upload-artifact@v4
with:
name: Maven Local
path: ~/.m2/repository/com/plusls/
summary:
runs-on: ubuntu-24.04
needs:
- build
steps:
- name: Checkout the sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: build-artifacts
- name: Make build summary
run: |
pip install jproperties
python .github/workflows/scripts/summary.py