Skip to content

Commit

Permalink
Migrate to unified buid script
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann Bernhardt committed Nov 22, 2021
1 parent 96c150e commit 4e16c00
Show file tree
Hide file tree
Showing 24 changed files with 764 additions and 1,582 deletions.
8 changes: 0 additions & 8 deletions .classpath

This file was deleted.

9 changes: 9 additions & 0 deletions .github/scripts/test-no-crash-reports.sh
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions .github/workflows/release-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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 latest build

on:
push:
branches: [ master, main ]

jobs:
build-and-release:
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: Update latest tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Latest build"
files: build/libs/*.jar
45 changes: 45 additions & 0 deletions .github/workflows/release-tags.yml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 26 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
.gradle/
eclipse/

.gradle
.settings
/.idea/
/run/
/build/
/eclipse/
.classpath
.project
/bin/
/config/
/crash-reports/
/logs/
options.txt
/saves/
usernamecache.json
banned-ips.json
banned-players.json
eula.txt
ops.json
server.properties
servers.dat
usercache.json
whitelist.json
/out/
*.iml
*.ipr
*.iws
*.iws
src/main/resources/mixins.*.json
17 changes: 0 additions & 17 deletions .project

This file was deleted.

1 change: 0 additions & 1 deletion Idea.bat

This file was deleted.

Loading

0 comments on commit 4e16c00

Please sign in to comment.