Skip to content

Commit

Permalink
Merge branch '1.19.4'
Browse files Browse the repository at this point in the history
# Conflicts:
#	fabric/build.gradle
#	gradle.properties
#	quilt/build.gradle
  • Loading branch information
Faboslav committed Aug 19, 2023
2 parents 3f7c7b3 + 465bca5 commit 03296e3
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 135 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
14 changes: 7 additions & 7 deletions .github/versions.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"1.20.1": "1.9.3",
"1.20": "1.9.3",
"1.19.4": "1.8.5",
"1.19.3": "1.8.5",
"1.19.2": "1.8.5",
"1.19.1": "1.8.5",
"1.19": "1.8.5",
"1.20.1": "1.9.4",
"1.20": "1.9.4",
"1.19.4": "1.8.6",
"1.19.3": "1.8.6",
"1.19.2": "1.8.6",
"1.19.1": "1.8.6",
"1.19": "1.8.6",
"1.18.2": "1.4.7",
"1.18.1": "1.2.5",
"1.18": "1.2.5"
Expand Down
82 changes: 64 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: "Build"

on: [ push ]
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
- "!master"

jobs:
build:
Expand All @@ -11,23 +18,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 @@ -14,8 +14,12 @@ env:
1.20.1
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 @@ -29,23 +33,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 @@ -57,7 +49,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 @@ -116,7 +107,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 @@ -148,7 +139,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 @@ -196,7 +187,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 @@ -227,92 +218,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
Loading

0 comments on commit 03296e3

Please sign in to comment.