Skip to content

Add wi-zoom 1.6 build for 25w02a (fabric) #17

Add wi-zoom 1.6 build for 25w02a (fabric)

Add wi-zoom 1.6 build for 25w02a (fabric) #17

Workflow file for this run

# 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
# For some reason the commit above doesn't automatically trigger the hugo
# workflow, so we need to explicitly start it here.
- name: Trigger hugo workflow
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run hugo.yml