Skip to content

Commit

Permalink
Add gradle ci setup
Browse files Browse the repository at this point in the history
  • Loading branch information
felixklauke committed Sep 6, 2020
1 parent 3f0bc96 commit e596d84
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 15 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Gradle Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Check with Gradle
run: ./gradlew check
- name: Build with Gradle
run: ./gradlew build
- name: Publish to GitHub Packages
run: ./gradlew publish
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Java CI with Gradle

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Check with Gradle
run: ./gradlew check
- name: Build with Gradle
run: ./gradlew build
57 changes: 51 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,51 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds
*/
plugins {
id 'java'
}

subprojects {
group "de.marmeladenoma"
version "0.1.0"

apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'maven'
apply plugin: 'maven-publish'

sourceCompatibility = 14
targetCompatibility = 14

repositories {
mavenLocal()
mavenCentral()
}

checkstyle {
maxWarnings = 0
maxErrors = 0
ignoreFailures = false
checkstyleTest.enabled = false
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/marmeladenoma/susceptor")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
}
9 changes: 0 additions & 9 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/6.6.1/userguide/multi_project_builds.html
*/

rootProject.name = 'susceptor'

0 comments on commit e596d84

Please sign in to comment.