Skip to content

Commit 4e11d3c

Browse files
authored
Merge pull request #28 from sa-shiro/1.20.5
v1.10
2 parents 0037db4 + f58105d commit 4e11d3c

File tree

164 files changed

+2596
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+2596
-92
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Keep LF line endings for forge .toml file
2-
*.toml text eol=lf
2+
*.toml text eol=lf

.github/workflows/cd.yml

Lines changed: 130 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,28 @@ on:
77
required: true
88
default: '1.0'
99
mc_version:
10-
description: 'Minecraft version(s) the data pack runs in'
10+
description: 'Minecraft version(s) the data pack runs in (human readable)'
1111
required: true
12-
default: '1.20'
12+
default: '1.17x-1.21x'
13+
mc_version_range:
14+
description: 'Minecraft version(s) the data pack runs in (encoded in version range spec)'
15+
required: true
16+
default: '>=1.17 <=1.21'
1317

1418
jobs:
15-
create_data_pack:
19+
deploy:
1620
runs-on: ubuntu-latest
21+
name: Build and publish project
1722
steps:
1823
- name: Checkout code
19-
uses: actions/checkout@v3.5.3
24+
uses: actions/checkout@v4
25+
with:
26+
show-progress: false
2027
- name: Extract tag
2128
id: tag_version
2229
run: echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
30+
31+
# Automatically set version numbers
2332
- name: Find and replace uninstall file name
2433
uses: jacobtomlinson/gha-find-replace@v3
2534
with:
@@ -33,78 +42,153 @@ jobs:
3342
find: "${version}"
3443
replace: ${{ github.event.inputs.tag }}
3544
regex: false
45+
- name: Find and replace supported mc versions
46+
uses: jacobtomlinson/gha-find-replace@v3
47+
with:
48+
find: "${mc_version}"
49+
replace: ${{ github.event.inputs.mc_version }}
50+
regex: false
3651

3752
# Check for existence of datapack, mod and/or resourcepack folders.
3853
- name: Check for data folder
3954
id: check_datapack_folder
40-
uses: andstor/file-existence-action@v2
55+
uses: andstor/file-existence-action@v3
4156
with:
4257
files: "data"
4358
- name: Check for mod folders
4459
id: check_mod_folder
45-
uses: andstor/file-existence-action@v2
60+
uses: andstor/file-existence-action@v3
4661
with:
4762
files: "META-INF, net, fabric.mod.json, assets"
4863
- name: Check for resource pack folder
4964
id: check_assets_folder
50-
uses: andstor/file-existence-action@v2
65+
uses: andstor/file-existence-action@v3
5166
with:
5267
files: "assets/minecraft"
5368

69+
# Package project
5470
- name: Create data pack zip file
5571
uses: montudor/action-zip@v1
5672
if: steps.check_datapack_folder.outputs.files_exists == 'true'
5773
with:
58-
args: zip -qq datapack.zip -r data pack.mcmeta pack.png LICENSE README.md
74+
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" -r . -x assets/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* other_editions/* CHANGES.md ".*"
5975
- name: Create mod jar file
6076
uses: montudor/action-zip@v1
6177
if: steps.check_mod_folder.outputs.files_exists == 'true'
6278
with:
63-
args: zip -qq mod.zip -r data assets META-INF net fabric.mod.json pack.mcmeta pack.png LICENSE README.md
79+
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r . -x unused/* src/* wiki/* other_editions/* CHANGES.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip"
6480
- name: Create asset pack zip file
6581
uses: montudor/action-zip@v1
6682
if: steps.check_assets_folder.outputs.files_exists == 'true'
6783
with:
68-
args: zip -qq assetpack.zip -r assets pack.mcmeta pack.png LICENSE README.md
84+
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r . -x data/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* other_editions/* CHANGES.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar"
6985

70-
- name: Create release
71-
id: create_release
72-
uses: actions/create-release@v1
73-
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
with:
76-
tag_name: v${{ github.event.inputs.tag }}
77-
release_name: Release v${{ github.event.inputs.tag }}
78-
draft: false
79-
prerelease: false
80-
81-
- name: Upload datapack release asset
82-
uses: actions/upload-release-asset@v1
86+
# Upload
87+
- name: Upload data pack version to Modrinth
88+
uses: Kir-Antipov/mc-publish@v3.3
8389
if: steps.check_datapack_folder.outputs.files_exists == 'true'
84-
env:
85-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8690
with:
87-
upload_url: ${{ steps.create_release.outputs.upload_url }}
88-
asset_path: ./datapack.zip
89-
asset_name: ${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip
90-
asset_content_type: application/zip
91-
- name: Upload mod release asset
92-
uses: actions/upload-release-asset@v1
91+
modrinth-id: zrzYrlm0
92+
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
93+
game-versions: ${{ github.event.inputs.mc_version_range }}
94+
game-version-filter: any
95+
fail-mode: skip
96+
97+
name: "[DP] Release v${{ github.event.inputs.tag }}"
98+
version: ${{ github.event.inputs.tag }}
99+
changelog-file: CHANGES.md
100+
101+
loaders: |
102+
datapack
103+
files: |
104+
./${{ github.event.repository.name }}-*.zip
105+
106+
- name: Upload mod version to Modrinth
107+
uses: Kir-Antipov/mc-publish@v3.3
93108
if: steps.check_mod_folder.outputs.files_exists == 'true'
94-
env:
95-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96109
with:
97-
upload_url: ${{ steps.create_release.outputs.upload_url }}
98-
asset_path: ./mod.zip
99-
asset_name: ${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar
100-
asset_content_type: application/jar
101-
- name: Upload assetpack release asset
102-
uses: actions/upload-release-asset@v1
103-
if: steps.check_assets_folder.outputs.files_exists == 'true'
104-
env:
105-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
modrinth-id: zrzYrlm0
111+
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
112+
game-versions: ${{ github.event.inputs.mc_version_range }}
113+
game-version-filter: any
114+
fail-mode: skip
115+
116+
name: "[Mod] Release v${{ github.event.inputs.tag }}"
117+
version: ${{ github.event.inputs.tag }}+mod
118+
changelog-file: CHANGES.md
119+
120+
dependencies: |
121+
fabric-api(optional){modrinth:P7dR8mSH}
122+
modmenu(optional){modrinth:mOgUt4GM}
123+
modmenu-badges-lib(optional){modrinth:eUw8l2Vi}
124+
midnightlib(optional){modrinth:codAaoxh}
125+
loaders: |
126+
fabric
127+
forge
128+
quilt
129+
files: |
130+
./${{ github.event.repository.name }}-*-mod.jar
131+
132+
- name: Upload data pack version to CurseForge
133+
uses: Kir-Antipov/mc-publish@v3.3
134+
if: steps.check_datapack_folder.outputs.files_exists == 'true'
135+
with:
136+
curseforge-id: 811803
137+
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
138+
game-versions: ${{ github.event.inputs.mc_version_range }}
139+
game-version-filter: any
140+
fail-mode: skip
141+
142+
name: "Release v${{ github.event.inputs.tag }}"
143+
version: ${{ github.event.inputs.tag }}
144+
changelog-file: CHANGES.md
145+
146+
loaders: |
147+
datapack
148+
files: |
149+
./${{ github.event.repository.name }}-*.zip
150+
151+
# - name: Upload mod version to CurseForge
152+
# uses: Kir-Antipov/mc-publish@v3.3
153+
# if: steps.check_mod_folder.outputs.files_exists == 'true'
154+
# with:
155+
# curseforge-id: 910095
156+
# curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
157+
# game-versions: ${{ github.event.inputs.mc_version_range }}
158+
# game-version-filter: any
159+
# fail-mode: skip
160+
161+
# name: "Release v${{ github.event.inputs.tag }}"
162+
# version: ${{ github.event.inputs.tag }}+mod
163+
# changelog-file: CHANGES.md
164+
165+
# dependencies: |
166+
# catalogue(optional){curseforge:459701}
167+
# catalogue-fabric(optional){curseforge:667377}
168+
# midnightlib(optional){curseforge:488090}
169+
# java: |
170+
# Java 21
171+
# Java 17
172+
# Java 18
173+
# loaders: |
174+
# fabric
175+
# forge
176+
# quilt
177+
# files: |
178+
# ./${{ github.event.repository.name }}-*-mod.jar
179+
180+
- name: Add changelog header for GitHub release
181+
run: sed -i '1i_Changelog:_' CHANGES.md
182+
- name: Upload outputs to GitHub releases
183+
uses: Kir-Antipov/mc-publish@v3.3
106184
with:
107-
upload_url: ${{ steps.create_release.outputs.upload_url }}
108-
asset_path: ./assetpack.zip
109-
asset_name: ${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip
110-
asset_content_type: application/zip
185+
github-token: ${{ secrets.GITHUB_TOKEN }}
186+
github-tag: v${{ github.event.inputs.tag }}
187+
game-versions: ${{ github.event.inputs.mc_version_range }}
188+
189+
name: Release v${{ github.event.inputs.tag }}
190+
version: v${{ github.event.inputs.tag }}
191+
changelog-file: CHANGES.md
192+
193+
files: |
194+
./${{ github.event.repository.name }}-*.@(zip|jar)

.github/workflows/cd_dev.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Continuous Deployment (Build)
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag:
6+
description: 'Version of the data pack'
7+
required: true
8+
default: '1.0'
9+
mc_version:
10+
description: 'Minecraft version(s) the data pack runs in (human readable)'
11+
required: true
12+
default: '1.17x-1.21x'
13+
mc_version_range:
14+
description: 'Minecraft version(s) the data pack runs in (encoded in version range spec)'
15+
required: true
16+
default: '>=1.17 <=1.21'
17+
18+
jobs:
19+
deploy:
20+
runs-on: ubuntu-latest
21+
name: Build and publish project
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
show-progress: false
27+
- name: Extract tag
28+
id: tag_version
29+
run: echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
30+
31+
# Automatically set version numbers
32+
- name: Find and replace uninstall file name
33+
uses: jacobtomlinson/gha-find-replace@v3
34+
with:
35+
find: "${file_name}"
36+
replace: ${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip
37+
regex: false
38+
include: "**uninstall.mcfunction"
39+
- name: Find and replace data pack version
40+
uses: jacobtomlinson/gha-find-replace@v3
41+
with:
42+
find: "${version}"
43+
replace: ${{ github.event.inputs.tag }}
44+
regex: false
45+
- name: Find and replace supported mc versions
46+
uses: jacobtomlinson/gha-find-replace@v3
47+
with:
48+
find: "${mc_version}"
49+
replace: ${{ github.event.inputs.mc_version }}
50+
regex: false
51+
52+
# Check for existence of datapack, mod and/or resourcepack folders.
53+
- name: Check for data folder
54+
id: check_datapack_folder
55+
uses: andstor/file-existence-action@v3
56+
with:
57+
files: "data"
58+
- name: Check for mod folders
59+
id: check_mod_folder
60+
uses: andstor/file-existence-action@v3
61+
with:
62+
files: "META-INF, net, fabric.mod.json, assets"
63+
- name: Check for resource pack folder
64+
id: check_assets_folder
65+
uses: andstor/file-existence-action@v3
66+
with:
67+
files: "assets/minecraft"
68+
69+
# Package project
70+
- name: Create data pack zip file
71+
uses: montudor/action-zip@v1
72+
if: steps.check_datapack_folder.outputs.files_exists == 'true'
73+
with:
74+
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" -r . -x assets/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* other_editions/* CHANGES.md ".*"
75+
- name: Create mod jar file
76+
uses: montudor/action-zip@v1
77+
if: steps.check_mod_folder.outputs.files_exists == 'true'
78+
with:
79+
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r . -x unused/* src/* wiki/* other_editions/* CHANGES.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip"
80+
- name: Create asset pack zip file
81+
uses: montudor/action-zip@v1
82+
if: steps.check_assets_folder.outputs.files_exists == 'true'
83+
with:
84+
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r . -x data/* net/* META-INF/* fabric.mod.json unused/* src/* wiki/* other_editions/* CHANGES.md ".*" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar"
85+
86+
# Upload
87+
- name: Capture datapack build artifact
88+
if: steps.check_datapack_folder.outputs.files_exists == 'true'
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: "Spawn Animations DEV (Datapack)"
92+
path: ./${{ github.event.repository.name }}-*.zip
93+
- name: Capture mod build artifact
94+
if: steps.check_mod_folder.outputs.files_exists == 'true'
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: "Spawn Animations DEV (Mod)"
98+
path: ./${{ github.event.repository.name }}-*-mod.jar
99+
100+
# Make sure that this comment doesn't cause issues just in case
101+
# - name: Upload mod version to CurseForge
102+
# uses: Kir-Antipov/mc-publish@v3.3
103+
# if: steps.check_mod_folder.outputs.files_exists == 'true'
104+
# with:
105+
# curseforge-id: 910095
106+
# curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
107+
# game-versions: ${{ github.event.inputs.mc_version_range }}
108+
# game-version-filter: any
109+
# fail-mode: skip
110+
111+
# name: "Release v${{ github.event.inputs.tag }}"
112+
# version: ${{ github.event.inputs.tag }}+mod
113+
# changelog-file: CHANGES.md
114+
115+
# dependencies: |
116+
# catalogue(optional){curseforge:459701}
117+
# catalogue-fabric(optional){curseforge:667377}
118+
# midnightlib(optional){curseforge:488090}
119+
# java: |
120+
# Java 21
121+
# Java 17
122+
# Java 18
123+
# loaders: |
124+
# fabric
125+
# forge
126+
# quilt
127+
# files: |
128+
# ./${{ github.event.repository.name }}-*-mod.jar

0 commit comments

Comments
 (0)