-
Notifications
You must be signed in to change notification settings - Fork 28
243 lines (205 loc) · 9.26 KB
/
release.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: Release
on:
workflow_dispatch:
inputs:
fabric:
description: "Fabric Release"
required: true
type: boolean
forge:
description: "Forge Release"
required: true
type: boolean
neo:
description: "Neo Release"
required: true
type: boolean
baseRef:
description: "Base ref for changelog generator"
required: true
type: string
headRef:
description: "Head ref for changelog generator"
required: true
type: string
env:
MINECRAFT_VERSION: "1.20.4"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Gradle Wrapper Verification
uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Elevate wrapper permissions
run: chmod +x ./gradlew
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build Mods
run: ./gradlew build
- name: Get WorldMap Version Fabric
run: echo "WORLDMAP_VERSION_FABRIC=$(./gradlew -q printWorldMapVersionFabric)" >> $GITHUB_ENV
- name: Get Minimap Version Fabric
run: echo "MINIMAP_VERSION_FABRIC=$(./gradlew -q printMinimapVersionFabric)" >> $GITHUB_ENV
- name: Get WorldMap Version Forge
run: echo "WORLDMAP_VERSION_FORGE=$(./gradlew -q printWorldMapVersionForge)" >> $GITHUB_ENV
- name: Get Minimap Version Forge
run: echo "MINIMAP_VERSION_FORGE=$(./gradlew -q printMinimapVersionForge)" >> $GITHUB_ENV
- name: Get WorldMap Version NeoForge
run: |
echo "WORLDMAP_VERSION_NEO=$(./gradlew -q printWorldMapVersionNeo)" >> $GITHUB_ENV
- name: Get Minimap Version NeoForge
run: |
echo "MINIMAP_VERSION_NEO=$(./gradlew -q printMinimapVersionNeo)" >> $GITHUB_ENV
- name: Get XaeroPlus Version
run: echo "XP_VERSION=$(./gradlew -q printXaeroPlusVersion)" >> $GITHUB_ENV
- name: Get Fabric Jar Filename
run: echo "XP_FABRIC=XaeroPlus-${{ env.XP_VERSION}}+fabric-${{ env.MINECRAFT_VERSION }}-WM${{ env.WORLDMAP_VERSION_FABRIC }}-MM${{ env.MINIMAP_VERSION_FABRIC }}" >> $GITHUB_ENV
- name: Get Forge Jar Filename
run: echo "XP_FORGE=XaeroPlus-${{ env.XP_VERSION}}+forge-${{ env.MINECRAFT_VERSION }}-WM${{ env.WORLDMAP_VERSION_FORGE }}-MM${{ env.MINIMAP_VERSION_FORGE }}" >> $GITHUB_ENV
- name: Get Neo Jar Filename
run: |
echo "XP_NEO=XaeroPlus-${{ env.XP_VERSION}}+neoforge-${{ env.MINECRAFT_VERSION }}-WM${{ env.WORLDMAP_VERSION_NEO }}-MM${{ env.MINIMAP_VERSION_NEO }}" >> $GITHUB_ENV
- name: Upload Fabric Artifact
if: ${{ inputs.fabric }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.XP_FABRIC }}
path: fabric/build/libs/${{ env.XP_FABRIC }}.jar
if-no-files-found: error
- name: Upload Forge Artifact
if: ${{ inputs.forge }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.XP_FORGE }}
path: forge/build/libs/${{ env.XP_FORGE }}.jar
if-no-files-found: error
- name: Upload Neo Artifact
if: ${{ inputs.neo }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.XP_NEO }}
path: neo/build/libs/${{ env.XP_NEO }}.jar
if-no-files-found: error
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
base-ref: ${{ inputs.baseRef }}
head-ref: ${{ inputs.headRef }}
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
xp_version: ${{ env.XP_VERSION }}
xp_fabric: ${{ env.XP_FABRIC }}
xp_forge: ${{ env.XP_FORGE }}
xp_neo: ${{ env.XP_NEO }}
worldmap_version_fabric: ${{ env.WORLDMAP_VERSION_FABRIC }}
minimap_version_fabric: ${{ env.MINIMAP_VERSION_FABRIC }}
worldmap_version_forge: ${{ env.WORLDMAP_VERSION_FORGE }}
minimap_version_forge: ${{ env.MINIMAP_VERSION_FORGE }}
worldmap_version_neo: ${{ env.WORLDMAP_VERSION_NEO }}
minimap_version_neo: ${{ env.MINIMAP_VERSION_NEO }}
release:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Download job artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: artifacts/
- name: Release Fabric CurseForge and Modrinth
if: ${{ inputs.fabric }}
uses: Kir-Antipov/[email protected]
with:
changelog: ${{ needs.build.outputs.changelog }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-id: 866084
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-id: EnPUzSTg
files: |
artifacts/${{ needs.build.outputs.xp_fabric }}.jar
name: ${{ needs.build.outputs.xp_version }} (Fabric) (WM${{ needs.build.outputs.worldmap_version_fabric }} MM${{ needs.build.outputs.minimap_version_fabric }})
version: ${{ needs.build.outputs.xp_version }}+fabric-${{ env.MINECRAFT_VERSION }}
loaders: |
fabric
quilt
game-versions: |
${{ env.MINECRAFT_VERSION }}
dependencies: |
xaerominimap@${{ needs.build.outputs.minimap_version_fabric }}(required){modrinth:1bokaNcj}{curseforge:263420}
xaeroworldmap@${{ needs.build.outputs.worldmap_version_fabric }}(required){modrinth:NcUtCpym}{curseforge:317780}
fabric-api(required){modrinth:P7dR8mSH}{curseforge:306612}
worldtools(optional){modrinth:FlFKBOIX}{curseforge:909868}
waystones(optional){modrinth:LOpKHB2A}{curseforge:245755}
fwaystones(optional){modrinth:sTZr7NVo}{curseforge:410902}
- name: Release Forge CurseForge and Modrinth
if: ${{ inputs.forge }}
uses: Kir-Antipov/[email protected]
with:
changelog: ${{ needs.build.outputs.changelog }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-id: 866084
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-id: EnPUzSTg
files: |
artifacts/${{ needs.build.outputs.xp_forge }}.jar
name: ${{ needs.build.outputs.xp_version }} (Forge) (WM${{ needs.build.outputs.worldmap_version_forge }} MM${{ needs.build.outputs.minimap_version_forge }})
version: ${{ needs.build.outputs.xp_version }}+forge-${{ env.MINECRAFT_VERSION }}
loaders: |
forge
game-versions: |
${{ env.MINECRAFT_VERSION }}
dependencies: |
xaerominimap@${{ needs.build.outputs.minimap_version_forge }}(required){modrinth:1bokaNcj}{curseforge:263420}
xaeroworldmap@${{ needs.build.outputs.worldmap_version_forge }}(required){modrinth:NcUtCpym}{curseforge:317780}
worldtools(optional){modrinth:FlFKBOIX}{curseforge:909868}
waystones(optional){modrinth:LOpKHB2A}{curseforge:245755}
- name: Release Neo CurseForge and Modrinth
if: ${{ inputs.neo }}
uses: Kir-Antipov/[email protected]
with:
changelog: ${{ needs.build.outputs.changelog }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-id: 866084
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-id: EnPUzSTg
files: |
artifacts/${{ needs.build.outputs.xp_neo }}.jar
name: ${{ needs.build.outputs.xp_version }} (NeoForge) (WM${{ needs.build.outputs.worldmap_version_neo }} MM${{ needs.build.outputs.minimap_version_neo }})
version: ${{ needs.build.outputs.xp_version }}+neoforge-${{ env.MINECRAFT_VERSION }}
loaders: |
neoforge
game-versions: |
${{ env.MINECRAFT_VERSION }}
dependencies: |
xaerominimap@${{ needs.build.outputs.minimap_version_neo }}(required){modrinth:1bokaNcj}{curseforge:263420}
xaeroworldmap@${{ needs.build.outputs.worldmap_version_neo }}(required){modrinth:NcUtCpym}{curseforge:317780}
worldtools(optional){modrinth:FlFKBOIX}{curseforge:909868}
waystones(optional){modrinth:LOpKHB2A}{curseforge:245755}
- name: Github Release
if: ${{ inputs.fabric }} || ${{ inputs.forge }} || ${{ inputs.neo }}
uses: ncipollo/release-action@v1
with:
tag: "${{ needs.build.outputs.xp_version }}"
commit: 1.20.1
artifacts: "artifacts/*.jar"
allowUpdates: true
makeLatest: true
body: |
For WorldMap and Minimap Versions:
* Fabric: WM${{ needs.build.outputs.worldmap_version_fabric }} MM${{ needs.build.outputs.minimap_version_fabric }}
* Forge: WM${{ needs.build.outputs.worldmap_version_forge }} MM${{ needs.build.outputs.minimap_version_forge }}
* NeoForge: WM${{ needs.build.outputs.worldmap_version_neo }} MM${{ needs.build.outputs.minimap_version_neo }}
${{ needs.build.outputs.changelog }}
omitBodyDuringUpdate: true