aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorJohann Bernhardt <johann.bernhardt@tum.de>2021-12-01 17:07:42 +0100
committerJohann Bernhardt <johann.bernhardt@tum.de>2021-12-01 17:07:42 +0100
commitbed9ce63b820d2bc973d1580daa19bceb8c0bb83 (patch)
treea1bb4bbd35920d00ef8a33d97f51ec26b5be7dd6 /.github/workflows
parent066a8cf9fd2691fa3a157f8688fa889e587dc2c3 (diff)
downloadGT5-Unofficial-bed9ce63b820d2bc973d1580daa19bceb8c0bb83.tar.gz
GT5-Unofficial-bed9ce63b820d2bc973d1580daa19bceb8c0bb83.tar.bz2
GT5-Unofficial-bed9ce63b820d2bc973d1580daa19bceb8c0bb83.zip
Migrate to unified build script and gradle 6
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build-and-test.yml (renamed from .github/workflows/gradle.yml)28
-rw-r--r--.github/workflows/release-tags.yml45
2 files changed, 60 insertions, 13 deletions
diff --git a/.github/workflows/gradle.yml b/.github/workflows/build-and-test.yml
index 75338898fa..6c9b3cbc6c 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/build-and-test.yml
@@ -1,16 +1,16 @@
# 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: Java CI with Gradle
+name: Build and test
on:
- push:
- branches: [ master, main ]
pull_request:
branches: [ master, main ]
+ push:
+ branches: [ master, main ]
jobs:
- build:
+ build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@@ -32,12 +32,14 @@ jobs:
- name: Build the mod
run: ./gradlew build
-
- - uses: "marvinpinto/action-automatic-releases@latest"
- with:
- repo_token: "${{ secrets.GITHUB_TOKEN }}"
- automatic_release_tag: "latest"
- prerelease: true
- title: "Latest Development Build"
- files: build/libs/*.jar
-
+
+ - name: Run server for 1 minute
+ run: |
+ mkdir run
+ echo "eula=true" > run/eula.txt
+ timeout 10 ./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