-
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 2.31 KB
/
add_mod_port.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
# Adds the necessary Hugo metadata when an existing mod update is ported to a new Minecraft version.
name: Add Mod Port
run-name: Add ${{ github.event.inputs.mod }} ${{ github.event.inputs.mod_version }} build for ${{ github.event.inputs.mc_version }}
on:
workflow_dispatch:
inputs:
mod:
description: "Mod ID (as it appears in config.toml)"
required: true
modloader:
description: "Mod loader (fabric or neoforge)"
required: true
mod_version:
description: "Mod version (without v or -MC)"
required: true
mc_version:
description: "Minecraft version"
required: true
fapi_version:
description: "Fabric API version (if modloader is fabric)"
required: false
file_id:
description: "CurseForge file ID"
required: true
jobs:
update-post:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: _scripts/requirements.txt
- name: Install dependencies
run: |
pip install -r _scripts/requirements.txt
- name: Run add_mod_port.py
run: |
python _scripts/add_mod_port.py \
"${{ github.event.inputs.mod }}" \
"${{ github.event.inputs.modloader }}" \
"${{ github.event.inputs.mod_version }}" \
"${{ github.event.inputs.mc_version }}" \
${{ github.event.inputs.modloader == 'fabric' && format('--fapi-version {0}', github.event.inputs.fapi_version) || '' }} \
"${{ github.event.inputs.file_id }}"
- name: Commit changes
run: |
MOD="${{ github.event.inputs.mod }}"
MOD_VERSION="${{ github.event.inputs.mod_version }}"
MC_VERSION="${{ github.event.inputs.mc_version }}"
MODLOADER="${{ github.event.inputs.modloader }}"
git config --local user.email "[email protected]"
git config --local user.name "Wurst-Bot"
git add .
git commit -m "[Wurst-Bot] Port $MOD $MOD_VERSION to Minecraft $MC_VERSION ($MODLOADER)"
git push