Update Mods #38171
This file contains hidden or 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
| name: Update Mods | |
| on: | |
| schedule: | |
| - cron: "43 4 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| release: | |
| description: "Trigger Modrinth pack files release" | |
| type: boolean | |
| default: false | |
| jobs: | |
| update-mods: | |
| name: Update Mods | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v5 | |
| - name: Setup Packwiz | |
| continue-on-error: true | |
| id: dl | |
| run: | | |
| wget -nv -P /usr/local/bin/ https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip | |
| unzip /usr/local/bin/*.zip -d /usr/local/bin/ | |
| chmod +x /usr/local/bin/packwiz | |
| - name: Setup Go | |
| if: steps.dl.outcome == 'failure' | |
| uses: actions/setup-go@v5 | |
| - name: Compile Packwiz On Download Failure | |
| if: steps.dl.outcome == 'failure' | |
| run: go install github.com/packwiz/packwiz@latest | |
| - name: Get Versions | |
| run: echo "MC_VERSIONS=$(ls fabric | tr '\n' ' ')" >> $GITHUB_ENV | |
| - name: Update Mods | |
| run: | | |
| for version in $MC_VERSIONS; do | |
| cd fabric/$version | |
| packwiz update --all -y | |
| cd ../.. | |
| done | |
| - name: Commit Changes | |
| uses: stefanzweifel/git-auto-commit-action@v6 | |
| id: commit | |
| with: | |
| commit_message: Update Mods | |
| commit_user_name: UnownBot | |
| commit_user_email: gitbot@unownplain.dev | |
| commit_author: UnownBot <gitbot@unownplain.dev> | |
| - name: Export Modrinth Packs | |
| if: steps.commit.outputs.changes_detected == 'true' || inputs.release | |
| run: | | |
| for version in $MC_VERSIONS; do | |
| cd fabric/$version | |
| packwiz mr export | |
| mv "UnownPlain's Modpack-$version.mrpack" UnownPlains-Modpack-$version.mrpack | |
| cd ../.. | |
| done | |
| - name: Release Modpack | |
| if: steps.commit.outputs.changes_detected == 'true' || inputs.release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: Modpack | |
| name: UnownPlain's Modpack (Fabric) | |
| prerelease: false | |
| files: fabric/*/UnownPlains-Modpack-*.mrpack |