-
Notifications
You must be signed in to change notification settings - Fork 10
189 lines (159 loc) · 6.92 KB
/
build-multiver.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: build (multiversion)
on:
release:
types: [created]
jobs:
webhook-message:
runs-on: ubuntu-latest
steps:
- name: Get branch name
id: get_branch
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: send building message to discord
if: "!startsWith(github.event.head_commit.message, '[skip]')"
uses: realRobotix/action-discord-notifier@release-master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message-title: Building mod from branch ${{ steps.get_branch.outputs.branch }}
- name: send not building message to discord
if: "startsWith(github.event.head_commit.message, '[skip]')"
uses: realRobotix/action-discord-notifier@release-master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message-title: Build skipped for branch ${{ steps.get_branch.outputs.branch }}
build_1_19:
if: "!startsWith(github.event.head_commit.message, '[skip]')"
strategy:
matrix:
java: [ 17 ]
runs-on: ubuntu-latest
steps:
- name: steal code from repository
uses: actions/checkout@v3
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: cache gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle
- name: give gradle permission to murder github servers
run: chmod +x ./gradlew
- name: gradle murders github servers
run: ./gradlew assemble -PmcVer="1.19.2"
- name: upload forge build artifacts
uses: actions/upload-artifact@v3
with:
name: logic_n_control-artifacts-forge-1.19.2
path: forge/build/libs/*.jar
- name: upload fabric build artifacts
uses: actions/upload-artifact@v3
with:
name: logic_n_control-artifacts-fabric-1.19.2
path: fabric/build/libs/*.jar
- name: upload merged build artifact to github
uses: actions/upload-artifact@v3
with:
name: logic_n_control-artifacts-merged-1.19.2
path: |
build/libs/merged/*.jar
- name: Publish Fabric
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CF_API_TOKEN }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
run: ./gradlew :fabric:build :fabric:publish :fabric:publishMods
- name: Publish Forge
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CF_API_TOKEN }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
run: ./gradlew :forge:build :forge:publish :forge:publishMods
- name: upload merged build artifact to discord
if: success()
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: build/libs/merged/*.jar
- name: send build failure message to discord
if: failure()
uses: ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: 'Build failed for 1.19.2!'
build_1_20:
if: "!startsWith(github.event.head_commit.message, '[skip]')"
strategy:
matrix:
java: [ 17 ]
runs-on: ubuntu-latest
steps:
- name: steal code from repository
uses: actions/checkout@v3
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: cache gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle
- name: give gradle permission to murder github servers
run: chmod +x ./gradlew
- name: gradle murders github servers
run: ./gradlew assemble -PmcVer="1.20.1"
- name: upload forge build artifacts
uses: actions/upload-artifact@v3
with:
name: logic_n_control-artifacts-forge-1.20.1
path: forge/build/libs/*.jar
- name: upload fabric build artifacts
uses: actions/upload-artifact@v3
with:
name: logic_n_control-artifacts-fabric-1.20.1
path: fabric/build/libs/*.jar
- name: upload merged build artifact to github
uses: actions/upload-artifact@v3
with:
name: logic_n_control-artifacts-merged-1.20.1
path: |
build/libs/merged/*.jar
- name: Publish Fabric
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CF_API_TOKEN }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
run: ./gradlew :fabric:build :fabric:publish :fabric:publishMods
- name: Publish Forge
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CF_API_TOKEN }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
run: ./gradlew :forge:build :forge:publish :forge:publishMods
- name: upload merged build artifact to discord
if: success()
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: build/libs/merged/*.jar
- name: send build failure message to discord
if: failure()
uses: ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: 'Build failed for 1.20.1!'