diff options
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.yml | 45 |
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 |