Skip to content

Commit

Permalink
Merge branch 'multi' into architectury-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Jun 17, 2023
2 parents 00cfb83 + 1e23f60 commit 7c81a44
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/matrix_prep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Display context
run: |
echo ref_name = ${{ github.ref_name }}
echo target_subproject = ${{ github.event.inputs.target_subproject }}
echo target_release_tag = ${{ github.event.inputs.target_release_tag }}
- id: setmatrix
run: python3 .github/workflows/scripts/matrix.py # ubuntu-22.04 uses Python 3.10.6
env:
TARGET_SUBPROJECT: ${{ inputs.target_subproject }}

- name: Print matrix
run: echo ${{ steps.setmatrix.outputs.matrix }}

outputs:
matrix: ${{ steps.setmatrix.outputs.matrix }}
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Display context
run: |
echo ref_name = ${{ github.ref_name }}
echo target_subproject = ${{ github.event.inputs.target_subproject }}
echo target_release_tag = ${{ github.event.inputs.target_release_tag }}
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/scripts/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

def main():
target_subproject_env = os.environ.get('TARGET_SUBPROJECT', '')
target_subprojects = set(target_subproject_env.split(',')) if target_subproject_env != '' else set()
target_subprojects = list(filter(None, target_subproject_env.split(',') if target_subproject_env != '' else []))
print('target_subprojects: {}'.format(target_subprojects))

with open('settings.json') as f:
settings: dict = json.load(f)

Expand Down Expand Up @@ -39,6 +41,9 @@ def main():
with open(os.environ['GITHUB_OUTPUT'], 'w') as f:
f.write('matrix={}\n'.format(json.dumps(matrix)))

print('matrix:')
print(json.dumps(matrix, indent=2))


if __name__ == '__main__':
main()
6 changes: 5 additions & 1 deletion .github/workflows/scripts/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def get_sha256_hash(file_path: str) -> str:


def main():
target_subprojects = os.environ.get('TARGET_SUBPROJECT', '').split(',')
target_subproject_env = os.environ.get('TARGET_SUBPROJECT', '')
target_subprojects = list(filter(None, target_subproject_env.split(',') if target_subproject_env != '' else []))
print('target_subprojects: {}'.format(target_subprojects))

with open('settings.json') as f:
settings: dict = json.load(f)

Expand All @@ -42,6 +45,7 @@ def main():
warnings = []
for subproject in settings['versions']:
if len(target_subprojects) > 0 and subproject not in target_subprojects:
print('skipping {}'.format(subproject))
continue
game_versions = read_prop('versions/{}/gradle.properties'.format(subproject), 'game_versions')
game_versions = game_versions.strip().replace('\\n', ', ')
Expand Down

0 comments on commit 7c81a44

Please sign in to comment.