Add Wurst 7.46.6 build for 25w02a #18
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 Jekyll metadata when an existing Wurst Client update is ported to a new Minecraft version. | |
name: Add Wurst Port | |
run-name: Add Wurst ${{ github.event.inputs.wurst_version }} build for ${{ github.event.inputs.mc_version }} | |
on: | |
workflow_dispatch: | |
inputs: | |
wurst_version: | |
description: "Wurst version (without v or -MC)" | |
required: true | |
mc_version: | |
description: "Minecraft version" | |
required: true | |
fapi_version: | |
description: "Fabric API version" | |
required: true | |
announce: | |
description: "Announce on WurstForum (only works for backports)" | |
required: false | |
default: "false" | |
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 Jekyll 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_wurst_port.py | |
run: | | |
python _scripts/add_wurst_port.py "${{ github.event.inputs.wurst_version }}" "${{ github.event.inputs.mc_version }}" "${{ github.event.inputs.fapi_version }}" | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Wurst-Bot" | |
git add . | |
git commit -m "[Wurst-Bot] Port Wurst ${{ github.event.inputs.wurst_version }} to Minecraft ${{ github.event.inputs.mc_version }}" | |
git push | |
# For some reason the commit above doesn't automatically trigger the | |
# Jekyll workflow, so we need to explicitly start it here. | |
- name: Trigger Jekyll workflow | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh workflow run jekyll.yml | |
announce: | |
runs-on: ubuntu-latest | |
needs: update-post | |
if: ${{ github.event.inputs.announce == 'true' }} | |
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 announce_wurst_backport.py | |
id: announce | |
env: | |
WURSTFORUM_TOKEN: ${{ secrets.WF_BOT_TOKEN }} | |
run: | | |
python _scripts/announce_wurst_backport.py "${{ github.event.inputs.wurst_version }}" "${{ github.event.inputs.mc_version }}" | |
- name: Write summary | |
run: | | |
echo "Discussion ID: ${{ steps.announce.outputs.discussion_id }}" >> $GITHUB_STEP_SUMMARY | |
echo "Link: <https://wurstforum.net/d/${{ steps.announce.outputs.discussion_id }}>" >> $GITHUB_STEP_SUMMARY |