-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
144 changed files
with
657 additions
and
492 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
allowed_mod_loaders=$1 | ||
curseforge_fabric_project_id=$2 | ||
curseforge_forge_project_id=$3 | ||
modrinth_fabric_project_id=$4 | ||
modrinth_forge_project_id=$5 | ||
|
||
IFS=',' read -r -a allowed_mod_loaders_array <<< "${allowed_mod_loaders//[\[\]\']/}" | ||
matrix_content="{\"include\":[" | ||
enabled_platforms=$(awk -F= '/enabled_platforms/{print $2}' gradle.properties | tr -d ' ') | ||
minecraft_version=$(awk -F= '/minecraft_version/{print $2; exit}' gradle.properties | tr -d ' ') | ||
|
||
for platform in $(echo $enabled_platforms | tr ',' ' '); do | ||
if [[ " ${allowed_mod_loaders_array[@]} " =~ " ${platform} " ]]; then | ||
if [[ "$platform" == "fabric" ]]; then | ||
supported_mod_loaders="\"fabric\",\"quilt\"" | ||
else | ||
supported_mod_loaders="\"$platform\"" | ||
fi | ||
|
||
if [[ "$platform" == "fabric" ]]; then | ||
curseforge_project_id="$curseforge_fabric_project_id" | ||
modrinth_project_id="$modrinth_fabric_project_id" | ||
else | ||
curseforge_project_id="$curseforge_forge_project_id" | ||
modrinth_project_id="$modrinth_forge_project_id" | ||
fi | ||
|
||
matrix_entry="{\"mod_loader\":\"$platform\",\"minecraft_version\":\"$minecraft_version\",\"supported_mod_loaders\":[$supported_mod_loaders],\"curseforge_project_id\":\"$curseforge_project_id\",\"modrinth_project_id\":\"$modrinth_project_id\"}," | ||
matrix_content+="$matrix_entry" | ||
fi | ||
done | ||
|
||
matrix_content="${matrix_content%,}]}" | ||
echo "Generated matrix: $matrix_content" | ||
echo "::set-output name=matrix::$matrix_content" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
tag=$1 | ||
|
||
changelog=$(cat CHANGELOG.md) | ||
|
||
list=$(echo "$changelog" | sed -n "/^## $tag/,/^## [0-9]/p" | sed -e '1d;$d' -e '/^$/d') | ||
|
||
echo "Parsed changelog:\n$list" | ||
echo "$list" > RELEASE_CHANGELOG.md |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
parse_properties_file() { | ||
local file=$1 | ||
while IFS='=' read -r key value; do | ||
# Trim leading/trailing whitespace from key and value | ||
key=$(echo "$key" | awk '{$1=$1;print}') | ||
value=$(echo "$value" | awk '{$1=$1;print}') | ||
|
||
# Skip comments, empty keys, and unwanted keys like "org.gradle.jvmargs" | ||
if [[ -z "$key" || "$key" =~ ^# || "$key" == "org.gradle.jvmargs" ]]; then | ||
continue | ||
fi | ||
|
||
# Convert key to uppercase and replace non-alphanumeric characters with underscores | ||
key=$(echo "$key" | tr '[:lower:]' '[:upper:]' | tr -c '[:alnum:]' '_') | ||
|
||
# Remove any trailing underscores | ||
key=$(echo "$key" | sed 's/_$//') | ||
|
||
# Output the key-value pair | ||
echo "${key}=${value}" | ||
echo "${key}=${value}" >> "$GITHUB_OUTPUT" | ||
done < "$file" | ||
} | ||
|
||
# Parse the main gradle.properties file | ||
parse_properties_file gradle.properties |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ jobs: | |
build: | ||
name: "Build project" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
timeout-minutes: 10 | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
|
||
|
@@ -25,26 +25,18 @@ jobs: | |
|
||
- name: "Parse gradle properties" | ||
id: gradle-properties | ||
run: | | ||
while IFS='=' read -r key value; do | ||
key=$(echo $key | awk '{$1=$1;print}') | ||
value=$(echo $value | awk '{$1=$1;print}') | ||
case "$key" in | ||
mod_java_version) echo "JAVA_VERSION=$value" >> $GITHUB_OUTPUT ;; | ||
minecraft_version) echo "MINECRAFT_VERSION=$value" >> $GITHUB_OUTPUT ;; | ||
mod_name) echo "MOD_NAME=$value" >> $GITHUB_OUTPUT ;; | ||
mod_version) echo "MOD_VERSION=$value" >> $GITHUB_OUTPUT ;; | ||
enabled_platforms) echo "ENABLED_PLATFORMS=$value" >> $GITHUB_OUTPUT ;; | ||
esac | ||
done < gradle.properties | ||
run: ./.github/scripts/parse-gradle-properties.sh | ||
|
||
- name: "Set up JDK" | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ steps.gradle-properties.outputs.JAVA_VERSION }} | ||
java-version: ${{ steps.gradle-properties.outputs.MOD_JAVA_VERSION }} | ||
distribution: temurin | ||
|
||
- name: "Generate matrix for the run job" | ||
id: set-matrix | ||
run: ./.github/scripts/generate-run-matrix.sh | ||
|
||
- name: "Run gradle build" | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
|
@@ -53,9 +45,13 @@ jobs: | |
gradle-version: wrapper | ||
arguments: build | ||
|
||
- name: "Generate matrix for the run job" | ||
id: set-matrix | ||
run: ./.github/scripts/generate-run-matrix.sh | ||
- name: "Upload Built JARs" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: built-jars | ||
if-no-files-found: error | ||
path: | | ||
./**/build/libs/*[0-9].jar | ||
run: | ||
name: Run ${{ matrix.mod_loader }} ${{ matrix.script }} | ||
|
@@ -72,35 +68,27 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: "Parse gradle properties" | ||
id: gradle-properties | ||
run: | | ||
while IFS='=' read -r key value; do | ||
key=$(echo $key | awk '{$1=$1;print}') | ||
value=$(echo $value | awk '{$1=$1;print}') | ||
case "$key" in | ||
mod_java_version) echo "JAVA_VERSION=$value" >> $GITHUB_OUTPUT ;; | ||
esac | ||
done < gradle.properties | ||
- name: "Set up JDK" | ||
uses: actions/setup-java@v4 | ||
- name: "Download Built JARs" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
java-version: ${{ steps.gradle-properties.outputs.JAVA_VERSION }} | ||
distribution: temurin | ||
name: built-jars | ||
|
||
- name: "Setup Gradle" | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
cache-read-only: true | ||
gradle-version: wrapper | ||
- name: "Parse gradle properties" | ||
id: gradle-properties | ||
run: ./.github/scripts/parse-gradle-properties.sh | ||
|
||
- name: "Accept eula" | ||
run: mkdir -p ${{ matrix.mod_loader }}/run && echo "eula=true" > ${{ matrix.mod_loader }}/run/eula.txt | ||
- name: "Copy mod jar to run/mods" | ||
run: mkdir -p run/mods && cp ${{ matrix.mod_loader }}/build/libs/* run/mods | ||
|
||
- name: Run ${{ matrix.mod_loader }} ${{ matrix.script }} | ||
uses: modmuss50/xvfb-action@v1 | ||
- name: Run ${{ matrix.version }} ${{ matrix.mod_loader }} | ||
uses: 3arthqu4ke/[email protected] | ||
with: | ||
run: ./.github/scripts/run-${{ matrix.script }}.sh ${{ matrix.mod_loader }} | ||
shell: bash | ||
mc: ${{ matrix.version }} | ||
modloader: ${{ matrix.mod_loader }} | ||
regex: .*${{ matrix.mod_loader }}.* | ||
mc-runtime-test: ${{ matrix.mod_loader_alias }} | ||
java: ${{ steps.gradle-properties.outputs.MOD_JAVA_VERSION }} | ||
java-distribution: temurin | ||
fabric-api: ${{ steps.gradle-properties.outputs.FABRIC_API_VERSION }} | ||
xvfb: false | ||
headlessmc-command: -lwjgl --retries 3 --jvm -Djava.awt.headless=true |
Oops, something went wrong.