-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI+CD and update gradle build process
- Loading branch information
Showing
10 changed files
with
185 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Caches Gradle dependencies and wrappers | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches/modules-2 | ||
~/.gradle/wrapper/dists | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/libs.versions.toml', '**/gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Run cibuild script | ||
id: exec | ||
run: ./scripts/cibuild | ||
|
||
- name: Cleanup Gradle Cache | ||
run: | | ||
sudo rm -f ~/.gradle/caches/modules-2/modules-2.lock | ||
sudo rm -f ~/.gradle/caches/modules-2/gc.properties | ||
- name: Create release if this is a tagged workflow | ||
uses: ncipollo/release-action@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
artifacts: build/libs/${{ steps.exec.outputs.slimjar }},build/libs/${{ steps.exec.outputs.libszip }},build/libs/${{ steps.exec.outputs.fatjar }} | ||
name: NiSCore ${{ steps.exec.outputs.version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
.idea/ | ||
.gradle/ | ||
jars/ | ||
build/ | ||
*/build/ | ||
mcserver/ | ||
|
||
EnhancedChat/*.sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '2.4' | ||
|
||
services: | ||
gradle: | ||
image: eclipse-temurin:17.0.2_8-jdk-focal | ||
environment: | ||
- CI=${CI:-} | ||
volumes: | ||
# gradle caches | ||
- ~/.gradle/caches/modules-2:/root/.gradle/caches/modules-2:z | ||
- ~/.gradle/wrapper/dists:/root/.gradle/wrapper/dists:z | ||
# mount working directory | ||
- ./:/opt/build:Z | ||
working_dir: /opt/build | ||
command: bash -c 'set -x && ./gradlew --no-daemon clean build --stacktrace' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[versions] | ||
paper-api = "1.18.1-R0.1-SNAPSHOT" | ||
jooq = "3.16.4" | ||
h2 = "2.1.210" | ||
flyway = "8.5.0" | ||
lombok = "1.18.22" | ||
guice = "5.1.0" | ||
reflections = "0.10.2" | ||
|
||
[libraries] | ||
paperapi = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper-api" } | ||
lombok = { group = "org.projectlombok", name = "lombok", version.ref = "lombok" } | ||
h2 = { group = "com.h2database", name = "h2", version.ref = "h2" } | ||
jooq = { group = "org.jooq", name = "jooq", version.ref = "jooq" } | ||
jooqmeta = { group = "org.jooq", name = "jooq-meta", version.ref = "jooq" } | ||
jooqmetaext = { group = "org.jooq", name = "jooq-meta-extensions", version.ref = "jooq" } | ||
jooqcodegen = { group = "org.jooq", name = "jooq-codegen", version.ref = "jooq" } | ||
flyway = { group = "org.flywaydb", name = "flyway-core", version.ref = "flyway" } | ||
guice = { group = "com.google.inject", name = "guice", version.ref = "guice" } | ||
reflections = { group = "org.reflections", name = "reflections", version.ref = "reflections" } | ||
|
||
[bundles] | ||
jooqgen = ["jooqmeta", "jooqmetaext", "jooqcodegen", "h2"] | ||
|
||
[plugins] | ||
jooqgradle = { id = "nu.studer.jooq", version = "5.2.1" } | ||
gitgradle = { id = "com.palantir.git-version", version = "0.12.3" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
if [[ -n "${DEBUG_MODE}" ]]; then | ||
set -x | ||
fi | ||
|
||
function usage() { | ||
echo -n \ | ||
"Usage: $(basename "$0") | ||
Build application for staging or a release. | ||
" | ||
} | ||
|
||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||
if [[ "${1:-}" == "--help" ]]; then | ||
usage | ||
else | ||
# if mounting the hosts cache folder, gradle inside the container will try and | ||
# acquire a file lock that the host machine may already be holding. this will | ||
# result in the container hanging indefinitely. stopping any existing daemons | ||
# on the host is the simplest way to 'solve' this issue | ||
if command -v java &>/dev/null; then | ||
./gradlew --stop | ||
fi | ||
|
||
chmod +x ./gradlew | ||
|
||
CI="${CI:-}" docker-compose -f docker-compose.ci.yml \ | ||
run --rm gradle | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
enableFeaturePreview 'VERSION_CATALOGS' | ||
|
||
dependencyResolutionManagement { | ||
repositories { | ||
mavenCentral() | ||
maven { url = 'https://papermc.io/repo/repository/maven-public/' } | ||
} | ||
|
||
versionCatalogs { | ||
libs { | ||
from files('libs.versions.toml') | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = 'plugins' |