diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..38ad74fa --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,44 @@ +name: CI + release + +on: [push, pull_request] + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + java: [1.8] + include: # test newest java on one os only, upload from ubuntu java8 + - os: ubuntu-latest + java: 1.15 + - os: ubuntu-latest + upload: true + + steps: + - uses: actions/checkout@v1 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Cache Gradle packages + # speed up the build by caching dependencies, downloaded versions + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Build with Gradle + run: ./gradlew build + - name: upload jar as asset + if: matrix.upload + uses: actions/upload-artifact@v2 + with: + name: zipped-ripme-jar + path: build/libs/*.jar + +# vim:set ts=2 sw=2 et: diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ea6ac25a..038c890f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,6 +1,6 @@ name: Java CI -on: [push, pull_request] +on: workflow_dispatch jobs: build: diff --git a/build.gradle.kts b/build.gradle.kts index 5572205f..0cdfc10c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ plugins { + id("fr.brouillard.oss.gradle.jgitver") version "0.9.1" id("jacoco") id("java") id("maven-publish") @@ -29,9 +30,15 @@ group = "com.rarchives.ripme" version = "1.7.94" description = "ripme" -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 +jgitver { + gitCommitIDLength = 8 + nonQualifierBranches = "main,master" + useGitCommitID = true +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } tasks.withType {