forked from KryptonCaptain/MagicBees
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from GTNewHorizons/unified-build-script
Migrated to unified build script
- Loading branch information
Showing
23 changed files
with
850 additions
and
187 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,27 @@ | ||
if [[ -d "run/crash-reports" ]]; then | ||
echo "Crash reports detected:" | ||
cat $directory/* | ||
exit 1 | ||
fi | ||
|
||
if grep --quiet "Fatal errors were detected" server.log; then | ||
echo "Fatal errors detected:" | ||
cat server.log | ||
exit 1 | ||
fi | ||
|
||
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" server.log; then | ||
echo "Server force stopped:" | ||
cat server.log | ||
exit 1 | ||
fi | ||
|
||
if grep --quiet 'Done .+ For help, type "help" or "?"' server.log; then | ||
echo "Server didn't finish startup:" | ||
cat server.log | ||
exit 1 | ||
fi | ||
|
||
echo "No crash reports detected" | ||
exit 0 | ||
|
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,45 @@ | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: Build and test | ||
|
||
on: | ||
pull_request: | ||
branches: [ master, main ] | ||
push: | ||
branches: [ master, main ] | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Setup the workspace | ||
run: ./gradlew setupCIWorkspace | ||
|
||
- name: Build the mod | ||
run: ./gradlew build | ||
|
||
- name: Run server for 1.5 minutes | ||
run: | | ||
mkdir run | ||
echo "eula=true" > run/eula.txt | ||
timeout 90 ./gradlew runServer | tee --append server.log || true | ||
- name: Test no errors reported during server run | ||
run: | | ||
chmod +x .github/scripts/test-no-error-reports.sh | ||
.github/scripts/test-no-error-reports.sh |
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,61 @@ | ||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: Release tagged build | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set release version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
|
||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'adopt' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Setup the workspace | ||
run: ./gradlew setupCIWorkspace | ||
|
||
- name: Build the mod | ||
run: ./gradlew build | ||
|
||
- name: Release under current tag | ||
uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
automatic_release_tag: "${{ env.RELEASE_VERSION }}" | ||
prerelease: false | ||
title: "${{ env.RELEASE_VERSION }}" | ||
files: build/libs/*.jar | ||
|
||
- name: Set repository owner and name | ||
run: | | ||
echo "REPOSITORY_OWNER=${GITHUB_REPOSITORY%/*}" >> $GITHUB_ENV | ||
echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV | ||
- name: Publish package | ||
run: ./gradlew publish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ARTIFACT_GROUP_ID: com.github.${{ env.REPOSITORY_OWNER }} | ||
ARTIFACT_ID: "${{ env.REPOSITORY_NAME }}" | ||
ARTIFACT_VERSION: "${{ env.RELEASE_VERSION }}" | ||
REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}" | ||
REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}" | ||
|
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 |
---|---|---|
@@ -1,103 +1,31 @@ | ||
# IntelliJ IDEA Files | ||
*.iml | ||
*.ipr | ||
*.iws | ||
out/ | ||
.idea/ | ||
|
||
# Eclipse Project Files | ||
.gradle | ||
.settings | ||
/.idea/ | ||
/run/ | ||
/build/ | ||
/eclipse/ | ||
.classpath | ||
.project | ||
.settings/ | ||
eclipse/ | ||
|
||
# Gradle | ||
.gradle | ||
gradle/ | ||
build/ | ||
debug/ | ||
bin/ | ||
config/ | ||
crash-reports/ | ||
logs/ | ||
mods/ | ||
saves/ | ||
usernamecache.json | ||
/bin/ | ||
/config/ | ||
/crash-reports/ | ||
/logs/ | ||
options.txt | ||
asm | ||
Thumbs.db | ||
|
||
## Windows | ||
Thumbs.db | ||
|
||
## gradle | ||
/.gradle | ||
/build | ||
|
||
## ForgeGradle | ||
/run | ||
|
||
## eclipse | ||
/.settings | ||
/.metadata | ||
/.classpath | ||
/.project | ||
/eclipse | ||
/bin | ||
|
||
## intellij | ||
/out | ||
/.idea | ||
/atlassian-ide-plugin.xml | ||
/*.ipr | ||
/*.iws | ||
/*.iml | ||
|
||
## Private Stuffs | ||
/private.properties | ||
|
||
## Jars | ||
*.jar | ||
!/gradle/wrapper/gradle-wrapper.jar | ||
|
||
### OSX (adds a lot of garbage)### | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
# Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
/saves/ | ||
usernamecache.json | ||
banned-ips.json | ||
banned-players.json | ||
eula.txt | ||
ops.json | ||
server.properties | ||
servers.dat | ||
usercache.json | ||
whitelist.json | ||
/out/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
src/main/resources/mixins.*.json | ||
*.bat | ||
LICENSE* | ||
forge* | ||
CREDITS* | ||
MinecraftForge* | ||
README.txt | ||
*.psd | ||
*.pdn | ||
|
||
/src/main/resources/assets/thaumcraft | ||
|
||
##API | ||
/src/api | ||
/models | ||
*.DS_Store | ||
!gradlew.bat |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.