mirror of
https://github.com/darksaid98/optim.git
synced 2026-12-01 14:38:49 +00:00
refactor: add mc-modpack-kit template
This commit is contained in:
108 files changed
+773
No files matched your search
@@ -0,0 +1,86 @@
|
||||
name: Update | Pipeline
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
parse-current-modpacks:
|
||||
name: Parse current modpacks to a list
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
|
||||
outputs:
|
||||
modpack_folders: ${{ steps.list_modpacks.outputs.modpack_folders }}
|
||||
|
||||
steps:
|
||||
|
||||
- name: Check Out Git Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
|
||||
- name: List Modpacks
|
||||
id: list_modpacks
|
||||
run: |
|
||||
modpackFolders=()
|
||||
for folder in *; do
|
||||
if [ -d "$folder" ]; then
|
||||
if [ -e "$folder/pack.toml" ]; then
|
||||
modpackFolders+=("$folder")
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "modpack_folders=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${modpackFolders[@]}")" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Current detected modpacks
|
||||
run: |
|
||||
echo "::notice ::⚙ Current detected modpacks: ${{ steps.list_modpacks.outputs.modpack_folders }}"
|
||||
|
||||
update_mods:
|
||||
name: Update Mods
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs:
|
||||
- parse-current-modpacks
|
||||
|
||||
if: ${{ (needs.parse-current-modpacks.outputs.modpack_folders) != '[]' }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
modpack: ${{ fromJson(needs.parse-current-modpacks.outputs.modpack_folders) }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ${{ matrix.modpack }}
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Packwiz
|
||||
uses: supplypike/setup-bin@v3
|
||||
with:
|
||||
uri: 'https://nightly.link/packwiz/packwiz/workflows/go/main/Linux%2064-bit%20x86.zip'
|
||||
name: 'packwiz'
|
||||
version: 'linux'
|
||||
|
||||
- name: Update Mods with Packwiz
|
||||
run: packwiz update -a -y
|
||||
|
||||
- name: Push the updated mod list via a Pull Request
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
commit-message: "update(${{ matrix.modpack }}): updated mods"
|
||||
title: 'update(${{ matrix.modpack }}): updated mods'
|
||||
body: >
|
||||
This PR is auto-generated by
|
||||
[create-pull-request](https://github.com/peter-evans/create-pull-request).
|
||||
Reference in new issue
Block a user