aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorJohann Bernhardt <johann.bernhardt@tum.de>2021-12-08 14:11:35 +0100
committerJohann Bernhardt <johann.bernhardt@tum.de>2021-12-08 14:11:35 +0100
commit1c8fd630d6654098d1820ee437d390a06e33faa0 (patch)
treef2f30637c13c9a885ace4e9a512bdf4904d69b86 /.github/workflows
parent61fe53085f5580b8313a5e598a5a3a0a1ca7d681 (diff)
downloadGT5-Unofficial-1c8fd630d6654098d1820ee437d390a06e33faa0.tar.gz
GT5-Unofficial-1c8fd630d6654098d1820ee437d390a06e33faa0.tar.bz2
GT5-Unofficial-1c8fd630d6654098d1820ee437d390a06e33faa0.zip
Unify build script
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build-and-test.yml45
-rw-r--r--.github/workflows/release-tags.yml45
2 files changed, 90 insertions, 0 deletions
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 0000000000..a60a2b6468
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -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 minute
+ run: |
+ mkdir run
+ echo "eula=true" > run/eula.txt
+ timeout 60 ./gradlew runServer || true
+
+ - name: Test no crashes happend
+ run: |
+ chmod +x .github/scripts/test-no-crash-reports.sh
+ .github/scripts/test-no-crash-reports.sh
diff --git a/.github/workflows/release-tags.yml b/.github/workflows/release-tags.yml
new file mode 100644
index 0000000000..25c354b227
--- /dev/null
+++ b/.github/workflows/release-tags.yml
@@ -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: 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