Skip to content

Commit

Permalink
Merge branch '1.21'
Browse files Browse the repository at this point in the history
* 1.21:
  Port
  port
  Updated dep
  Updated dependency
  Updated build
  Fixed fabric version
  build fix
  Removed unused assets
  Port
  • Loading branch information
Faboslav committed Jul 11, 2024
2 parents 9fea953 + 65a89f5 commit 3ca7f7c
Show file tree
Hide file tree
Showing 40 changed files with 203 additions and 369 deletions.
98 changes: 0 additions & 98 deletions .github/assets/curseforge/quilt.html

This file was deleted.

72 changes: 0 additions & 72 deletions .github/assets/modrinth/quilt.md

This file was deleted.

16 changes: 16 additions & 0 deletions .github/scripts/generate-run-matrix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

matrix_content="{\"include\":["
enabled_platforms=$(awk -F= '/enabled_platforms/{print $2}' gradle.properties | tr -d ' ')
version=$(awk -F= '/minecraft_version/{print $2; exit}' gradle.properties | tr -d ' ')

for platform in $(echo $enabled_platforms | tr ',' ' '); do
matrix_entry="{\"mod_loader\":\"$platform\",\"version\":\"$version\",\"script\":\"client\"},"
matrix_content+="$matrix_entry"
matrix_entry="{\"mod_loader\":\"$platform\",\"version\":\"$version\",\"script\":\"server\"},"
matrix_content+="$matrix_entry"
done

matrix_content="${matrix_content%,}]}"
echo "Generated matrix: $matrix_content"
echo "::set-output name=matrix::$matrix_content"
1 change: 1 addition & 0 deletions .github/scripts/run-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SUCCESS_PATTERN='minecraft:textures/atlas/mob_effects\.png-atlas'
ERROR_PATTERNS=(
'For more details see the full crash report file'
' end of report '
'Failed download after 3 attempts'
)
TIMEOUT=1800
ELAPSED=0
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/run-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SUCCESS_PATTERN='For help, type "help"'
ERROR_PATTERNS=(
'For more details see the full crash report file'
' end of report '
'Failed download after 3 attempts'
)
TIMEOUT=1800
ELAPSED=0
Expand Down
94 changes: 69 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,98 @@ on:

jobs:
build:
name: "Build project"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mod_loader: [fabric, forge, neoforge]
script: [client, server]

name: Run ${{ matrix.mod_loader }} ${{ matrix.script }}
timeout-minutes: 15
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: "Checkout repository"
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Check if the mod loader is supported"
id: check-mod-loader
- name: "Parse gradle properties"
id: gradle-properties
run: |
if [ -d ${{ matrix.mod_loader }} ]; then
echo "Mod loader is supported"
echo "is_mod_loader_supported=true" >> $GITHUB_OUTPUT
else
echo "Mod loader is not supported"
echo "is_mod_loader_supported=false" >> $GITHUB_OUTPUT
fi
while IFS='=' read -r key value; do
key=$(echo $key | awk '{$1=$1;print}')
value=$(echo $value | awk '{$1=$1;print}')
case "$key" in
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
- name: "Set up JDK"
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true'
uses: actions/setup-java@v4.0.0
- name: "Set up JDK 17"
if: steps.gradle-properties.outputs.MINECRAFT_VERSION != '1.20.6' && steps.gradle-properties.outputs.MINECRAFT_VERSION != '1.21'
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin

- name: "Set up JDK 21"
if: steps.gradle-properties.outputs.MINECRAFT_VERSION == '1.20.6' || steps.gradle-properties.outputs.MINECRAFT_VERSION == '1.21'
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin

- name: "Run gradle build"
uses: gradle/gradle-build-action@v3
with:
generate-job-summary: false
gradle-version: wrapper
arguments: build

- name: "Generate matrix for the run job"
id: set-matrix
run: ./.github/scripts/generate-run-matrix.sh

run:
name: Run ${{ matrix.mod_loader }} ${{ matrix.script }}
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix: ${{fromJson(needs.build.outputs.matrix)}}
timeout-minutes: 15

steps:
- name: "Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Set up JDK 17"
if: matrix.mod_loader.version != '1.20.6' && matrix.mod_loader.version != '1.21'
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin

- name: "Set up JDK 21"
if: matrix.version == '1.20.6' || matrix.version == '1.21'
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin

- name: "Setup Gradle and run build"
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true'
uses: gradle/gradle-build-action@v2.11.1
uses: gradle/gradle-build-action@v3
with:
cache-read-only: false
cache-read-only: true
gradle-version: wrapper
arguments: ${{ matrix.mod_loader }}:build

- name: "Accept eula"
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true'
run: mkdir -p ${{ matrix.mod_loader }}/run && echo "eula=true" > ${{ matrix.mod_loader }}/run/eula.txt

- name: Run ${{ matrix.mod_loader }} ${{ matrix.script }}
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true'
uses: modmuss50/xvfb-action@v1
with:
run: ./.github/scripts/run-${{ matrix.script }}.sh ${{ matrix.mod_loader }}
Expand Down
Loading

0 comments on commit 3ca7f7c

Please sign in to comment.