Skip to content

Commit

Permalink
Merge commit '55417f4ca3b530006e9d32a521ffdcbff2c56b97' into architec…
Browse files Browse the repository at this point in the history
…tury-test

# Conflicts:
#	.github/workflows/release.yml
#	build.gradle
#	common.gradle
#	settings.json
#	versions/1.20.6-fabric/gradle.properties
  • Loading branch information
Fallen-Breath committed Oct 22, 2024
2 parents c2fe3c9 + 55417f4 commit fe1ac59
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 62 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ jobs:
# FALLENS_MAVEN_TOKEN: ${{ secrets.FALLENS_MAVEN_TOKEN }}

summary:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs:
- build

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Download build artifacts
uses: actions/download-artifact@v4
Expand All @@ -104,6 +107,8 @@ jobs:
path: build-artifacts

- name: Make build summary
run: python3 .github/workflows/scripts/summary.py # ubuntu-22.04 uses Python 3.10.6
run: |
pip install jproperties
python .github/workflows/scripts/summary.py
env:
TARGET_SUBPROJECT: ${{ inputs.target_subproject }}
7 changes: 5 additions & 2 deletions .github/workflows/matrix_prep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ on:

jobs:
matrix_prep:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12

- id: setmatrix
run: python3 .github/workflows/scripts/matrix.py # ubuntu-22.04 uses Python 3.10.6
run: python .github/workflows/scripts/matrix.py
env:
TARGET_SUBPROJECT: ${{ inputs.target_subproject }}

Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,17 @@ jobs:
- name: Read common properties
id: properties_g
uses: christian-draeger/read-properties@1.1.1
uses: BrycensRanch/read-properties-action@v1
with:
path: gradle.properties
properties: 'mod_name mod_version'
file: gradle.properties
all: true

- name: Read version-specific properties
id: properties_v
uses: christian-draeger/read-properties@1.1.1
uses: BrycensRanch/read-properties-action@v1
with:
path: ${{ format('versions/{0}/gradle.properties', matrix.subproject) }}
properties: 'minecraft_version game_versions'

- name: Fix game version
id: game_versions
run: |
# Fixed \n in game_versions isn't parsed by christian-draeger/read-properties as a line separator
echo 'value<<EOF' >> $GITHUB_OUTPUT
echo -e "${{ steps.properties_v.outputs.game_versions }}" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
file: ${{ format('versions/{0}/gradle.properties', matrix.subproject) }}
all: true

- name: Prepare file information
id: file_info
Expand Down Expand Up @@ -196,7 +188,7 @@ jobs:
version-type: release

loaders: ${{ matrix.mod_brand }}
game-versions: ${{ steps.game_versions.outputs.value }}
game-versions: ${{ steps.properties_v.outputs.game_versions }}
game-version-filter: any
dependencies: '' # declare the dependencies explicitly, so mc-publish won't try to load from fabric.mod.json

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/scripts/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
import json
import os

import jproperties


def read_prop(file_name: str, key: str) -> str:
with open(file_name) as prop:
return next(filter(
lambda l: l.split('=', 1)[0].strip() == key,
prop.readlines()
)).split('=', 1)[1].lstrip()
configs = jproperties.Properties()
with open(file_name, 'rb') as f:
configs.load(f)
return configs[key].data


def get_sha256_hash(file_path: str) -> str:
Expand Down Expand Up @@ -48,7 +49,7 @@ def main():
print('skipping {}'.format(subproject))
continue
game_versions = read_prop('versions/{}/gradle.properties'.format(subproject), 'game_versions')
game_versions = game_versions.strip().replace('\\n', ', ')
game_versions = game_versions.strip().replace('\r', '').replace('\n', ', ')
file_paths = glob.glob('build-artifacts/{}/build/libs/*.jar'.format(subproject))
file_paths = list(filter(lambda fp: not fp.endswith('-sources.jar') and not fp.endswith('-dev.jar') and not fp.endswith('-shadow.jar'), file_paths))
if len(file_paths) == 0:
Expand Down
70 changes: 37 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,48 @@ plugins {
}

preprocess {
def mc114_fabric = createNode('1.14.4-fabric', 1_14_04, '')
def mc115_fabric = createNode('1.15.2-fabric', 1_15_02, '')
def mc116_fabric = createNode('1.16.5-fabric', 1_16_05, '')
def mc117_fabric = createNode('1.17.1-fabric', 1_17_01, '')
def mc118_fabric = createNode('1.18.2-fabric', 1_18_02, '')
def mc119_fabric = createNode('1.19.4-fabric', 1_19_04, '')
def mc120_fabric = createNode('1.20.6-fabric', 1_20_06, '')
def mc121_fabric = createNode('1.21.1-fabric', 1_21_01, '')
def mc114_fabric = createNode('1.14.4-fabric', 1_14_04, '')
def mc115_fabric = createNode('1.15.2-fabric', 1_15_02, '')
def mc116_fabric = createNode('1.16.5-fabric', 1_16_05, '')
def mc117_fabric = createNode('1.17.1-fabric', 1_17_01, '')
def mc118_fabric = createNode('1.18.2-fabric', 1_18_02, '')
def mc119_fabric = createNode('1.19.4-fabric', 1_19_04, '')
def mc1204_fabric = createNode('1.20.4-fabric', 1_20_04, '')
def mc1206_fabric = createNode('1.20.6-fabric', 1_20_06, '')
def mc121_fabric = createNode('1.21.1-fabric', 1_21_01, '')

def mc115_forge = createNode('1.15.2-forge' , 1_15_02, '')
def mc116_forge = createNode('1.16.5-forge' , 1_16_05, '')
def mc117_forge = createNode('1.17.1-forge' , 1_17_01, '')
def mc118_forge = createNode('1.18.2-forge' , 1_18_02, '')
def mc119_forge = createNode('1.19.4-forge' , 1_19_04, '')
def mc120_forge = createNode('1.20.6-forge' , 1_20_06, '')
def mc121_forge = createNode('1.21.1-forge' , 1_21_01, '')
def mc115_forge = createNode('1.15.2-forge' , 1_15_02, '')
def mc116_forge = createNode('1.16.5-forge' , 1_16_05, '')
def mc117_forge = createNode('1.17.1-forge' , 1_17_01, '')
def mc118_forge = createNode('1.18.2-forge' , 1_18_02, '')
def mc119_forge = createNode('1.19.4-forge' , 1_19_04, '')
def mc1204_forge = createNode('1.20.4-forge' , 1_20_04, '')
def mc1206_forge = createNode('1.20.6-forge' , 1_20_06, '')
def mc121_forge = createNode('1.21.1-forge' , 1_21_01, '')

def mc120_neoforge = createNode('1.20.6-neoforge', 1_20_06, '')
def mc121_neoforge = createNode('1.21.1-neoforge', 1_21_01, '')
def mc1206_neoforge = createNode('1.20.6-neoforge', 1_20_06, '')
def mc121_neoforge = createNode('1.21.1-neoforge', 1_21_01, '')

mc114_fabric.link(mc115_fabric, null)
mc115_fabric.link(mc116_fabric, null)
mc116_fabric.link(mc117_fabric, null)
mc117_fabric.link(mc118_fabric, null)
mc118_fabric.link(mc119_fabric, null)
mc119_fabric.link(mc120_fabric, null)
mc120_fabric.link(mc121_fabric, null)
mc114_fabric .link(mc115_fabric , null)
mc115_fabric .link(mc116_fabric , null)
mc116_fabric .link(mc117_fabric , null)
mc117_fabric .link(mc118_fabric , null)
mc118_fabric .link(mc119_fabric , null)
mc119_fabric .link(mc1204_fabric, null)
mc1204_fabric.link(mc1206_fabric, null)
mc1206_fabric.link(mc121_fabric , null)

mc115_fabric.link(mc115_forge, null)
mc116_fabric.link(mc116_forge, null)
mc117_fabric.link(mc117_forge, null)
mc118_fabric.link(mc118_forge, null)
mc119_fabric.link(mc119_forge, null)
mc120_fabric.link(mc120_forge, null)
mc121_fabric.link(mc121_forge, null)
mc115_fabric .link(mc115_forge , null)
mc116_fabric .link(mc116_forge , null)
mc117_fabric .link(mc117_forge , null)
mc118_fabric .link(mc118_forge , null)
mc119_fabric .link(mc119_forge , null)
mc1204_fabric.link(mc1204_forge, null)
mc1206_fabric.link(mc1206_forge, null)
mc121_fabric .link(mc121_forge , null)

mc120_fabric.link(mc120_neoforge, null)
mc121_fabric.link(mc121_neoforge, null)
mc1206_fabric.link(mc1206_neoforge, null)
mc121_fabric .link(mc121_neoforge , null)
}

tasks.register('buildAndGather') {
Expand Down
2 changes: 2 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"1.17.1-fabric",
"1.18.2-fabric",
"1.19.4-fabric",
"1.20.4-fabric",
"1.20.6-fabric",
"1.21.1-fabric",

Expand All @@ -14,6 +15,7 @@
"1.17.1-forge",
"1.18.2-forge",
"1.19.4-forge",
"1.20.4-forge",
"1.20.6-forge",
"1.21.1-forge",

Expand Down
2 changes: 1 addition & 1 deletion versions/1.16.5-fabric/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Build Information
# The target mc versions for the mod during mod publishing, separated with \n
game_versions=1.16.4\n1.16.5
game_versions=1.16\n1.16.1\n1.16.2\n1.16.3\n1.16.4\n1.16.5

# Dependencies
# fabric_api_version=0.42.0+1.16
Expand Down
2 changes: 1 addition & 1 deletion versions/1.17.1-fabric/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Build Information
# The target mc versions for the mod during mod publishing, separated with \n
game_versions=1.17.1
game_versions=1.17\n1.17.1

# Dependencies
# fabric_api_version=0.46.1+1.17
Expand Down
2 changes: 1 addition & 1 deletion versions/1.18.2-fabric/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Build Information
# The target mc versions for the mod during mod publishing, separated with \n
game_versions=1.18.2
game_versions=1.18\n1.18.1\n1.18.2

# Dependencies
# fabric_api_version=0.76.0+1.18.2
2 changes: 1 addition & 1 deletion versions/1.19.4-fabric/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Build Information
# The target mc versions for the mod during mod publishing, separated with \n
game_versions=1.19.4
game_versions=1.19\n1.19.1\n1.19.2\n1.19.3\n1.19.4

# Dependencies
# fabric_api_version=0.87.2+1.19.4
17 changes: 17 additions & 0 deletions versions/1.20.4-fabric/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Loom Properties
# check these on https://fallen-breath.github.io/fabric-versions/?&version=1.20.4
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loom.platform=fabric

# Mod Metadata
# https://fabricmc.net/versions.html
fabric_loader_version=0.15.10
minecraft_dependency=1.20.4

# Build Information
# The target mc versions for the mod during mod publishing, separated with \n
game_versions=1.20\n1.20.1\n1.20.2\n1.20.3\n1.20.4

# Dependencies
# fabric_api_version=0.97.2+1.20.4
14 changes: 14 additions & 0 deletions versions/1.20.4-forge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Loom Properties
# check these on https://fallen-breath.github.io/fabric-versions/?&version=1.20.4
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loom.platform=forge

# Mod Metadata
# https://files.minecraftforge.net/net/minecraftforge/forge/index_1.20.4.html
forge_version=49.0.48
minecraft_dependency=[1.20, 1.20.4]

# Build Information
# The target mc versions for the mod during mod publishing, separated with \n
game_versions=1.20\n1.20.1\n1.20.2\n1.20.3\n1.20.4

0 comments on commit fe1ac59

Please sign in to comment.