Skip to content

Commit ce4be4f

Browse files
committed
Fix glob pattern
1 parent 4c50d9b commit ce4be4f

File tree

2 files changed

+101
-3
lines changed

2 files changed

+101
-3
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ jobs:
7171
uses: montudor/action-zip@v1
7272
if: steps.check_datapack_folder.outputs.files_exists == 'true'
7373
with:
74-
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-datapack.zip" -r data overlay_* 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 data 'overlay_*' pack.mcmeta pack.png LICENSE README.md
7575
- name: Create mod jar file
7676
uses: montudor/action-zip@v1
7777
if: steps.check_mod_folder.outputs.files_exists == 'true'
7878
with:
79-
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-mod.jar" -r data overlay_* 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 data 'overlay_*' assets META-INF net fabric.mod.json pack.mcmeta pack.png LICENSE README.md
8080
- name: Create asset pack zip file
8181
uses: montudor/action-zip@v1
8282
if: steps.check_assets_folder.outputs.files_exists == 'true'
8383
with:
84-
args: zip -qq "${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ github.event.inputs.mc_version }}-resourcepack.zip" -r assets overlay_* 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 assets 'overlay_*' pack.mcmeta pack.png LICENSE README.md
8585

8686
# Upload
8787
- name: Upload data pack version to Modrinth
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Continuous Deployment (Test)
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.20x'
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.20.4'
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 data 'overlay_*' pack.mcmeta pack.png LICENSE README.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 data 'overlay_*' assets META-INF net fabric.mod.json pack.mcmeta pack.png LICENSE README.md
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 assets 'overlay_*' pack.mcmeta pack.png LICENSE README.md
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: "Dynamic Lights (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: "Dynamic Lights (Mod)"
98+
path: ./${{ github.event.repository.name }}-*-mod.jar

0 commit comments

Comments
 (0)