Add wi-zoom 1.6 build for 25w03a (fabric) #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }} (${{ github.event.inputs.modloader }}) | |
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 | |
distinct_id: | |
description: "Automatically set by the return-dispatch action (leave blank if running manually)" | |
required: false | |
permissions: | |
# To push the automated commit. | |
contents: write | |
# To trigger the hugo workflow. | |
actions: write | |
jobs: | |
update-post: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }} | |
run: echo ${{ github.event.inputs.distinct_id }} | |
- 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 | |
- name: Trigger hugo workflow | |
id: hugo_dispatch | |
uses: codex-/return-dispatch@v2 | |
with: | |
token: ${{ github.token }} | |
owner: Wurst-Imperium | |
repo: wimods.net | |
ref: master | |
workflow: hugo.yml | |
- name: Wait for hugo workflow to finish (run ${{ steps.hugo_dispatch.outputs.run_id }}) | |
uses: codex-/await-remote-run@v1 | |
with: | |
token: ${{ github.token }} | |
owner: Wurst-Imperium | |
repo: wimods.net | |
run_id: ${{ steps.hugo_dispatch.outputs.run_id }} | |
run_timeout_seconds: 300 # 5 minutes |