Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions .github/workflows/lifecycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,15 @@ jobs:

- id: matrices # TODO: build origin matrices dynamically, consider collapsing this into a .py
name: Construct matrices
env:
PR_COMMENT_BODY: ${{ github.event.pull_request.body }}
run: |
import os
import json
import re

build_matrix = {"include": []}
run_matrix = {"version": []}

build_data = [
{"dir": "api", "java": "8"},
# new-mc-version build data
{"dir": "1_21_10", "mc": "1.21.10", "lex": "60.0.0", "neo": "50-beta", "java": "21"},
{"dir": "1_21_6", "mc": "1.21.8", "lex": "58.0.0", "neo": "51", "java": "21"},
{"dir": "1_21_6", "mc": "1.21.7", "lex": "57.0.0", "neo": "25-beta", "java": "21"},
Expand Down Expand Up @@ -123,7 +119,6 @@ jobs:
]

run_data = [
# new-mc-version run data
{"mc": "1.21.10", "type": "lexforge", "modloader": "forge", "regex": ".*forge.*", "java": "21"},
{"mc": "1.21.10", "type": "neoforge", "modloader": "neoforge", "regex": ".*neoforge.*", "java": "21"},
{"mc": "1.21.10", "type": "fabric", "modloader": "fabric", "regex": ".*fabric.*", "java": "21"},
Expand Down Expand Up @@ -187,24 +182,12 @@ jobs:
]

dirs_to_filter = []
mc_versions = []

match os.getenv('GITHUB_EVENT_NAME'):
case 'pull_request':
if "${{ steps.filter.outcome }}" == "success":
# Filter matrices based on the detected changes
dirs_to_filter = json.loads('${{ steps.filter.outputs.changes }}')
comment_body = os.getenv('PR_COMMENT_BODY')
print("PR-comment:", comment_body)
if comment_body:
pattern = r'Automatic commit: build and run ([0-9\.]*[0-9]*) in ([0-9_]*[0-9]*)'
match = re.search(pattern, comment_body)
if match:
mc_versions = [ match.group(1) ]
dirs_to_filter = [ match.group(2) ]
print('Matched PR body', mc_versions, dirs_to_filter)
else:
print('PR body did not match')

case 'workflow_dispatch':
input_dirs = '${{ github.event.inputs.dirs }}'
Expand All @@ -224,8 +207,8 @@ jobs:
build_matrix['include'], run_matrix['version'] = build_data, run_data

if dirs_to_filter:
build_matrix['include'].extend([item for item in build_data if item["dir"] in dirs_to_filter and (item["mc"] in mc_versions or not mc_versions)])
mc_versions = mc_versions if mc_versions else [item.get("mc") for item in build_matrix["include"] if "mc" in item]
build_matrix['include'].extend([item for item in build_data if item["dir"] in dirs_to_filter])
mc_versions = [item.get("mc") for item in build_matrix["include"] if "mc" in item]
run_matrix['version'].extend([item for item in run_data if item["mc"] in mc_versions])

with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
Expand Down
57 changes: 0 additions & 57 deletions .github/workflows/new-mc-version.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@ replay_*.log
/libs/
/logs/
/.architectury-transformer/
/.venv/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Run MC test client
uses: headlesshq/mc-runtime-test@4.1.0 <!-- x-release-please-version -->
with:
mc: 1.21.5
mc: 1.21.4
modloader: fabric
regex: .*fabric.*
mc-runtime-test: fabric
Expand Down
170 changes: 0 additions & 170 deletions check-for-new-mc-versions.py

This file was deleted.

5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.