Skip to content

Commit abb77f5

Browse files
author
Johann Bernhardt
authored
Merge pull request #9 from GTNewHorizons/unified-build-script
Migrate to unified buid script
2 parents 96c150e + 4e16c00 commit abb77f5

24 files changed

+764
-1582
lines changed

.classpath

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
directory="run/crash-reports"
2+
if [ -d $directory ]; then
3+
echo "Crash reports detected:"
4+
cat $directory/*
5+
exit 1
6+
else
7+
echo "No crash reports detected"
8+
exit 0
9+
fi

.github/workflows/build-and-test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Build and test
5+
6+
on:
7+
pull_request:
8+
branches: [ master, main ]
9+
push:
10+
branches: [ master, main ]
11+
12+
jobs:
13+
build-and-test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up JDK 8
21+
uses: actions/setup-java@v2
22+
with:
23+
java-version: '8'
24+
distribution: 'adopt'
25+
cache: gradle
26+
27+
- name: Grant execute permission for gradlew
28+
run: chmod +x gradlew
29+
30+
- name: Setup the workspace
31+
run: ./gradlew setupCIWorkspace
32+
33+
- name: Build the mod
34+
run: ./gradlew build
35+
36+
- name: Run server for 1 minute
37+
run: |
38+
mkdir run
39+
echo "eula=true" > run/eula.txt
40+
timeout 10 ./gradlew runServer || true
41+
42+
- name: Test no crashes happend
43+
run: |
44+
chmod +x .github/scripts/test-no-crash-reports.sh
45+
.github/scripts/test-no-crash-reports.sh

.github/workflows/release-latest.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Release latest build
5+
6+
on:
7+
push:
8+
branches: [ master, main ]
9+
10+
jobs:
11+
build-and-release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set release version
19+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
20+
21+
- name: Set up JDK 8
22+
uses: actions/setup-java@v2
23+
with:
24+
java-version: '8'
25+
distribution: 'adopt'
26+
cache: gradle
27+
28+
- name: Grant execute permission for gradlew
29+
run: chmod +x gradlew
30+
31+
- name: Setup the workspace
32+
run: ./gradlew setupCIWorkspace
33+
34+
- name: Build the mod
35+
run: ./gradlew build
36+
37+
- name: Update latest tag
38+
uses: "marvinpinto/action-automatic-releases@latest"
39+
with:
40+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
41+
automatic_release_tag: "latest"
42+
prerelease: false
43+
title: "Latest build"
44+
files: build/libs/*.jar

.github/workflows/release-tags.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Release tagged build
5+
6+
on:
7+
push:
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set release version
20+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
21+
22+
- name: Set up JDK 8
23+
uses: actions/setup-java@v2
24+
with:
25+
java-version: '8'
26+
distribution: 'adopt'
27+
cache: gradle
28+
29+
- name: Grant execute permission for gradlew
30+
run: chmod +x gradlew
31+
32+
- name: Setup the workspace
33+
run: ./gradlew setupCIWorkspace
34+
35+
- name: Build the mod
36+
run: ./gradlew build
37+
38+
- name: Release under current tag
39+
uses: "marvinpinto/action-automatic-releases@latest"
40+
with:
41+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
42+
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
43+
prerelease: false
44+
title: "${{ env.RELEASE_VERSION }}"
45+
files: build/libs/*.jar

.gitignore

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1-
.gradle/
2-
eclipse/
3-
1+
.gradle
2+
.settings
3+
/.idea/
4+
/run/
5+
/build/
6+
/eclipse/
7+
.classpath
8+
.project
9+
/bin/
10+
/config/
11+
/crash-reports/
12+
/logs/
13+
options.txt
14+
/saves/
15+
usernamecache.json
16+
banned-ips.json
17+
banned-players.json
18+
eula.txt
19+
ops.json
20+
server.properties
21+
servers.dat
22+
usercache.json
23+
whitelist.json
24+
/out/
425
*.iml
526
*.ipr
6-
*.iws
27+
*.iws
28+
src/main/resources/mixins.*.json

.project

Lines changed: 0 additions & 17 deletions
This file was deleted.

Idea.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)