Skip to content

Commit

Permalink
Merge branch '1.19.3' into 1.19.4
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
  • Loading branch information
Faboslav committed Aug 18, 2023
2 parents b4b45af + c592891 commit 0d37be1
Show file tree
Hide file tree
Showing 13 changed files with 192 additions and 142 deletions.
26 changes: 26 additions & 0 deletions .github/actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Setup environment"
description: "Common setup before using gradle"
runs:
using: "composite"
steps:
- name: "Checkout repository"
uses: actions/[email protected]
with:
fetch-depth: 0

- name: "Set up JDK"
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: 17

- name: "Initialize caches"
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-build-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-build-
32 changes: 32 additions & 0 deletions .github/scripts/run-client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

./gradlew $1:runClient > gradle_client_output.txt 2>&1 &

SUCCESS_PATTERN='minecraft:textures/atlas/mob_effects\.png-atlas'
ERROR_PATTERNS=(
'For more details see the full crash report file'
' end of report '
)
TIMEOUT=1800
ELAPSED=0

while [ $ELAPSED -lt $TIMEOUT ]; do
if grep -Eq "$SUCCESS_PATTERN" gradle_client_output.txt; then
pkill -P $$
exit 0
fi

for ERROR_PATTERN in "${ERROR_PATTERNS[@]}"; do
if grep -Eq "$ERROR_PATTERN" gradle_client_output.txt; then
pkill -P $$
exit 1
fi
done

sleep 1
ELAPSED=$((ELAPSED + 1))
done

if [ $ELAPSED -ge $TIMEOUT ]; then
exit 1
fi
32 changes: 32 additions & 0 deletions .github/scripts/run-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

./gradlew $1:runServer --args="nogui" > gradle_server_output.txt 2>&1 &

SUCCESS_PATTERN='For help, type "help"'
ERROR_PATTERNS=(
'For more details see the full crash report file'
' end of report '
)
TIMEOUT=1800
ELAPSED=0

while [ $ELAPSED -lt $TIMEOUT ]; do
if grep -Eq "$SUCCESS_PATTERN" gradle_server_output.txt; then
pkill -P $$
exit 0
fi

for ERROR_PATTERN in "${ERROR_PATTERNS[@]}"; do
if grep -Eq "$ERROR_PATTERN" gradle_server_output.txt; then
pkill -P $$
exit 1
fi
done

sleep 1
ELAPSED=$((ELAPSED + 1))
done

if [ $ELAPSED -ge $TIMEOUT ]; then
exit 1
fi
73 changes: 56 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,62 @@ jobs:
steps:
- name: "Checkout repository"
uses: actions/[email protected]

- name: "Set up JDK"
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: 17

- name: "Initialize caches"
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-build-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-build-
fetch-depth: 0

- name: "Setup environment"
uses: ./.github/actions/setup-environment

- name: "Build with gradle"
run: ./gradlew build
run: ./gradlew build

run-client:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mod_loader: [ "fabric", "forge" ]
name: Run ${{ matrix.mod_loader }} client
timeout-minutes: 30

steps:
- name: "Checkout repository"
uses: actions/[email protected]
with:
fetch-depth: 0

- name: "Setup environment"
uses: ./.github/actions/setup-environment

- name: Run ${{ matrix.mod_loader }} client
uses: modmuss50/xvfb-action@v1
with:
run: ./.github/scripts/run-client.sh ${{ matrix.mod_loader }}
shell: bash

run-server:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mod_loader: [ "fabric", "forge" ]
name: Run ${{ matrix.mod_loader }} server
timeout-minutes: 30

steps:
- name: "Checkout repository"
uses: actions/[email protected]
with:
fetch-depth: 0

- name: "Setup environment"
uses: ./.github/actions/setup-environment

- name: "Accept eula"
run: mkdir -p ${{ matrix.mod_loader }}/run && echo "eula=true" > ${{ matrix.mod_loader }}/run/eula.txt

- name: Run ${{ matrix.mod_loader }} server
run: ./.github/scripts/run-server.sh ${{ matrix.mod_loader }}
shell: bash
118 changes: 14 additions & 104 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ env:
1.19.4
FABRIC_DEPENDENCIES: |
fabric-api | depends | *
QUILT_DEPENDENCIES: |
qsl | depends | *
FABRIC_LOADERS: |
fabric
quilt
FORGE_LOADERS: |
forge
neoforge
RETRY_ATTEMPTS: 3
RELAY_DELAY: 10000
VERSION_RESOLVER: latest
Expand All @@ -28,23 +32,11 @@ jobs:
steps:
- name: "Checkout repository"
uses: actions/[email protected]

- name: "Set up JDK"
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: 17

- name: "Initialize caches"
uses: actions/[email protected]
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-build-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-build-
fetch-depth: 0

- name: "Setup environment"
uses: ./.github/actions/setup-environment

- name: "Build with gradle"
run: ./gradlew build
Expand All @@ -56,7 +48,6 @@ jobs:
path: |
fabric/build/libs/friendsandfoes-fabric-${{ github.ref_name }}.jar
forge/build/libs/friendsandfoes-forge-${{ github.ref_name }}.jar
quilt/build/libs/friendsandfoes-quilt-${{ github.ref_name }}.jar
LICENSE.txt
publish-license-to-release:
Expand Down Expand Up @@ -115,7 +106,7 @@ jobs:

files-primary: fabric/build/libs/friendsandfoes-fabric-${{ github.ref_name }}.jar
version-type: ${{ env.VERSION_TYPE }}
loaders: fabric
loaders: ${{ env.FABRIC_LOADERS }}
game-versions: ${{ env.GAME_VERSIONS }}
name: Friends&Foes ${{ github.ref_name }} (Fabric)
dependencies: ${{ env.FABRIC_DEPENDENCIES }}
Expand Down Expand Up @@ -147,7 +138,7 @@ jobs:

files-primary: fabric/build/libs/friendsandfoes-fabric-${{ github.ref_name }}.jar
version-type: ${{ env.VERSION_TYPE }}
loaders: fabric
loaders: ${{ env.FABRIC_LOADERS }}
game-versions: ${{ env.GAME_VERSIONS }}
name: Friends&Foes ${{ github.ref_name }} (Fabric)
version: fabric-${{ github.ref_name }}
Expand Down Expand Up @@ -195,7 +186,7 @@ jobs:

files-primary: forge/build/libs/friendsandfoes-forge-${{ github.ref_name }}.jar
version-type: ${{ env.VERSION_TYPE }}
loaders: forge
loaders: ${{ env.FORGE_LOADERS }}
game-versions: ${{ env.GAME_VERSIONS }}
name: Friends&Foes ${{ github.ref_name }} (Forge)
java: ${{ env.JAVA_VERSIONS }}
Expand Down Expand Up @@ -226,92 +217,11 @@ jobs:

files-primary: forge/build/libs/friendsandfoes-forge-${{ github.ref_name }}.jar
version-type: ${{ env.VERSION_TYPE }}
loaders: forge
loaders: ${{ env.FORGE_LOADERS }}
game-versions: ${{ env.GAME_VERSIONS }}
name: Friends&Foes ${{ github.ref_name }} (Forge)
version: forge-${{ github.ref_name }}
java: ${{ env.JAVA_VERSIONS }}
retry-attempts: ${{ env.RETRY_ATTEMPTS }}
retry-delay: ${{ env.RETRY_DELAY }}
version-resolver: ${{ env.VERSION_RESOLVER }}


publish-quilt-to-github:
needs: build
runs-on: ubuntu-latest
name: "Publish Quilt to GitHub"
timeout-minutes: 30

steps:
- name: "Download artifacts"
uses: actions/download-artifact@v3
with:
name: "friends-and-foes"

- name: "Publish Quilt to GitHub"
uses: AButler/[email protected]
with:
files: quilt/build/libs/friendsandfoes-quilt-${{ github.ref_name }}.jar
repo-token: ${{ secrets.GITHUB_TOKEN }}

publish-quilt-to-curseforge:
needs: build
runs-on: ubuntu-latest
name: "Publish Quilt to CurseForge"
timeout-minutes: 30

steps:
- name: "Download artifacts"
uses: actions/download-artifact@v3
with:
name: "friends-and-foes"

- name: "Publish Quilt to CurseForge"
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 628248
curseforge-token: ${{ secrets.CURSEFORGE_RELEASE_TOKEN }}

files-primary: quilt/build/libs/friendsandfoes-quilt-${{ github.ref_name }}.jar
version-type: ${{ env.VERSION_TYPE }}
loaders: quilt
game-versions: ${{ env.GAME_VERSIONS }}
name: Friends&Foes ${{ github.ref_name }} (Quilt)
dependencies: ${{ env.QUILT_DEPENDENCIES }}
java: ${{ env.JAVA_VERSIONS }}

retry-attempts: ${{ env.RETRY_ATTEMPTS }}
retry-delay: ${{ env.RETRY_DELAY }}
version-resolver: ${{ env.VERSION_RESOLVER }}

publish-quilt-to-modrinth:
needs: build
runs-on: ubuntu-latest
name: "Publish Quilt to Modrinth"
timeout-minutes: 30

steps:
- name: "Download artifacts"
uses: actions/download-artifact@v3
with:
name: "friends-and-foes"

- name: "Publish Quilt to Modrinth"
uses: Kir-Antipov/[email protected]
with:
modrinth-id: NxP9xmhw
modrinth-featured: true
modrinth-unfeature-mode: version-intersection
modrinth-token: ${{ secrets.MODRINTH_RELEASE_TOKEN }}

files-primary: quilt/build/libs/friendsandfoes-quilt-${{ github.ref_name }}.jar
version-type: ${{ env.VERSION_TYPE }}
loaders: quilt
game-versions: ${{ env.GAME_VERSIONS }}
name: Friends&Foes ${{ github.ref_name }} (Quilt)
version: quilt-${{ github.ref_name }}
dependencies: ${{ env.QUILT_DEPENDENCIES }}
java: ${{ env.JAVA_VERSIONS }}
retry-attempts: ${{ env.RETRY_ATTEMPTS }}
retry-delay: ${{ env.RETRY_DELAY }}
version-resolver: ${{ env.VERSION_RESOLVER }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ classes/
.vscode
.settings
*.launch
.architectury-transformer
.architectury-transformer
gradle_client_output.txt
gradle_server_output.txt
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.0.+" apply false
id "dev.architectury.loom" version "1.3.+" apply false
}

architectury {
Expand Down
Loading

0 comments on commit 0d37be1

Please sign in to comment.