diff options
| author | Martin Robertz <dream-master@gmx.net> | 2021-12-01 20:55:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-01 20:55:03 +0100 |
| commit | 8f32d27b91d8bec76d23f092274527d88d9466c3 (patch) | |
| tree | 5a1123859f3ae1d55ff13370dac4a9faec4c7449 /.github | |
| parent | 9ca59dd58d42e5cb6d6f47c3318e3f443d72e646 (diff) | |
| parent | 68b8ca682803b88cb3abb01ace2415bfd68f006e (diff) | |
| download | GT5-Unofficial-8f32d27b91d8bec76d23f092274527d88d9466c3.tar.gz GT5-Unofficial-8f32d27b91d8bec76d23f092274527d88d9466c3.tar.bz2 GT5-Unofficial-8f32d27b91d8bec76d23f092274527d88d9466c3.zip | |
Merge pull request #720 from GTNewHorizons/unify-build-script
Unify build script draft
Diffstat (limited to '.github')
| -rw-r--r-- | .github/scripts/test-no-crash-reports.sh | 9 | ||||
| -rw-r--r-- | .github/workflows/build-and-test.yml | 45 | ||||
| -rw-r--r-- | .github/workflows/gradle.yml | 34 | ||||
| -rw-r--r-- | .github/workflows/release-tags.yml | 45 |
4 files changed, 99 insertions, 34 deletions
diff --git a/.github/scripts/test-no-crash-reports.sh b/.github/scripts/test-no-crash-reports.sh new file mode 100644 index 0000000000..c67e342c06 --- /dev/null +++ b/.github/scripts/test-no-crash-reports.sh @@ -0,0 +1,9 @@ +directory="run/crash-reports" +if [ -d $directory ]; then + echo "Crash reports detected:" + cat $directory/* + exit 1 +else + echo "No crash reports detected" + exit 0 +fi diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000000..6c9b3cbc6c --- /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 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/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index e3b06da698..0000000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build Project - -on: - push: - branches: [ experimental ] - pull_request: - branches: [ experimental ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - cache: gradle - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Setup the workspace - run: ./gradlew setupCIWorkspace - - name: Build with Gradle - run: ./gradlew build - - test-scala-presence: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Check - uses: mattsb42-meta/not-grep@1.0.0 - with: - config-file: ./.github/test-scala-presence.toml 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 |
