-
-
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.
# Conflicts: # gradle.properties
- Loading branch information
Showing
13 changed files
with
192 additions
and
142 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,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- |
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,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 |
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,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 |
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 |
---|---|---|
|
@@ -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 |
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,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 | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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 }} | ||
|
@@ -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 }} | ||
|
@@ -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 }} | ||
|
@@ -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 }} |
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
Oops, something went wrong.