-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move off of JCenter / TravisCI to Maven Central / GitHub Actions. (#26)
- Loading branch information
Showing
10 changed files
with
279 additions
and
105 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,116 @@ | ||
# | ||
# CI build that assembles artifacts and runs tests. | ||
# If validation is successful this workflow releases from the main dev branch. | ||
# | ||
# - skipping CI: add [skip ci] to the commit message | ||
# - skipping release: add [skip release] to the commit message | ||
# | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
tags-ignore: [v*] # release tags are autogenerated after a successful CI, no need to run CI against them | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**.md' | ||
pull_request: | ||
branches: ['**'] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- scala-version: 2.11.8 | ||
spark-version: 2.3.0 | ||
- scala-version: 2.11.8 | ||
spark-version: 2.4.3 | ||
- scala-version: 2.12.11 | ||
spark-version: 2.4.3 | ||
- scala-version: 2.12.11 | ||
spark-version: 3.0.0 | ||
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 # https://github.com/actions/checkout | ||
with: | ||
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci | ||
- name: Set up Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Perform build | ||
env: | ||
SCALA_VERSION: ${{ matrix.scala-version }} | ||
SPARK_VERSION: ${{ matrix.spark-version }} | ||
run: ./gradlew build publishToMavenLocal -s -PscalaVersion=$SCALA_VERSION -PsparkVersion=$SPARK_VERSION | ||
|
||
github-release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
# Release job, only for pushes to the main development branch | ||
if: github.event_name == 'push' | ||
&& github.ref == 'refs/heads/main' | ||
&& github.repository == 'linkedin/isolation-forest' | ||
&& !contains(toJSON(github.event.commits.*.message), '[skip release]') | ||
steps: | ||
- name: Check out code | ||
# https://github.com/actions/checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# Needed to get all tags. Refer https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci | ||
fetch-depth: '0' | ||
- name: Setup Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Release | ||
run: ./gradlew githubRelease -s | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# release: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# include: | ||
# - scala-version: 2.11.8 | ||
# spark-version: 2.3.0 | ||
# - scala-version: 2.11.8 | ||
# spark-version: 2.4.3 | ||
# - scala-version: 2.12.11 | ||
# spark-version: 2.4.3 | ||
# - scala-version: 2.12.11 | ||
# spark-version: 3.0.0 | ||
# if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
# steps: | ||
# - name: Check out code | ||
# uses: actions/checkout@v2 # https://github.com/actions/checkout | ||
# with: | ||
# fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci | ||
# - name: Set up Java | ||
# uses: actions/setup-java@v1 | ||
# with: | ||
# java-version: 1.8 | ||
# - name: Perform build | ||
# env: | ||
# SCALA_VERSION: ${{ matrix.scala-version }} | ||
# SPARK_VERSION: ${{ matrix.spark-version }} | ||
# run: ./gradlew build publishToMavenLocal -s -PscalaVersion=$SCALA_VERSION -PsparkVersion=$SPARK_VERSION | ||
# - name: Perform release | ||
# # Release job, only for pushes to the main development branch | ||
# if: github.event_name == 'push' | ||
# && github.ref == 'refs/heads/master' | ||
# && github.repository == 'linkedin/isolation-forest' | ||
# && !contains(toJSON(github.event.commits.*.message), '[skip release]') | ||
# run: ./gradlew publishToSonatype closeAndReleaseStagingRepository -s -PscalaVersion=$SCALA_VERSION -PsparkVersion=$SPARK_VERSION | ||
# env: | ||
# SCALA_VERSION: ${{ matrix.scala-version }} | ||
# SPARK_VERSION: ${{ matrix.spark-version }} | ||
# SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | ||
# SONATYPE_PWD: ${{ secrets.SONATYPE_PWD }} | ||
# PGP_KEY: ${{ secrets.PGP_KEY }} | ||
# PGP_PWD: ${{ secrets.PGP_PWD }} |
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,93 @@ | ||
apply plugin: "java" | ||
|
||
def licenseSpec = copySpec { | ||
from project.rootDir | ||
include "LICENSE" | ||
include "NOTICE" | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier 'sources' | ||
from sourceSets.main.allSource | ||
with licenseSpec | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc) { | ||
classifier 'javadoc' | ||
from tasks.javadoc | ||
with licenseSpec | ||
} | ||
|
||
jar { | ||
with licenseSpec | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
archives javadocJar | ||
} | ||
|
||
apply plugin: "maven-publish" // https://docs.gradle.org/current/userguide/publishing_maven.html | ||
publishing { | ||
publications { | ||
isolationForestJar(MavenPublication) { | ||
from components.java | ||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
artifactId = project.archivesBaseName | ||
|
||
pom { | ||
name = artifactId | ||
description = "A Spark/Scala implementation of the isolation forest unsupervised outlier detection algorithm." | ||
|
||
url = "https://github.com/linkedin/isolation-forest" | ||
licenses { | ||
license { | ||
name = 'BSD 2-CLAUSE' | ||
url = 'https://github.com/linkedin/isolation-forest/blob/master/LICENSE' | ||
distribution = 'repo' | ||
} | ||
} | ||
developers { | ||
[ | ||
'jverbus:James Verbus' | ||
].each { devData -> | ||
developer { | ||
def devInfo = devData.split(':') | ||
id = devInfo[0] | ||
name = devInfo[1] | ||
url = 'https://github.com/' + devInfo[0] | ||
roles = ["Core developer"] | ||
} | ||
} | ||
} | ||
scm { | ||
url = 'https://github.com/linkedin/isolation-forest.git' | ||
} | ||
issueManagement { | ||
url = 'https://github.com/linkedin/isolation-forest/issues' | ||
system = 'GitHub issues' | ||
} | ||
ciManagement { | ||
url = 'https://travis-ci.com/linkedin/isolation-forest' | ||
system = 'Travis CI' | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Useful for testing - running "publish" will create artifacts/pom in a local dir. | ||
repositories { maven { url = "$rootProject.buildDir/repo" } } | ||
} | ||
|
||
// Fleshes out problems with Maven pom generation when building. | ||
tasks.build.dependsOn("publishIsolationForestJarPublicationToMavenLocal") | ||
|
||
apply plugin: 'signing' // https://docs.gradle.org/current/userguide/signing_plugin.html | ||
signing { | ||
if (System.getenv("PGP_KEY")) { | ||
useInMemoryPgpKeys(System.getenv("PGP_KEY"), System.getenv("PGP_PWD")) | ||
sign publishing.publications.isolationForestJar | ||
} | ||
} |
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,39 @@ | ||
// | ||
// Shipkit tasks | ||
// | ||
|
||
// Plugin jars are added to the buildscript classpath in the root build.gradle file. | ||
apply plugin: "org.shipkit.shipkit-auto-version" // https://github.com/shipkit/shipkit-auto-version | ||
|
||
apply plugin: "org.shipkit.shipkit-changelog" // https://github.com/shipkit/shipkit-changelog | ||
tasks.named("generateChangelog") { | ||
previousRevision = project.ext.'shipkit-auto-version.previous-tag' | ||
githubToken = System.getenv("GITHUB_TOKEN") | ||
repository = "linkedin/isolation-forest" | ||
} | ||
|
||
apply plugin: "org.shipkit.shipkit-github-release" // https://github.com/shipkit/shipkit-changelog | ||
tasks.named("githubRelease") { | ||
def genTask = tasks.named("generateChangelog").get() | ||
dependsOn genTask | ||
repository = genTask.repository | ||
changelog = genTask.outputFile | ||
githubToken = System.getenv("GITHUB_TOKEN") | ||
newTagRevision = System.getenv("GITHUB_SHA") | ||
} | ||
|
||
// | ||
// Maven Central configuration | ||
// | ||
|
||
apply plugin: "io.github.gradle-nexus.publish-plugin" // https://github.com/gradle-nexus/publish-plugin/ | ||
nexusPublishing { | ||
repositories { | ||
if (System.getenv("SONATYPE_PWD")) { | ||
sonatype { | ||
username = System.getenv("SONATYPE_USER") | ||
password = System.getenv("SONATYPE_PWD") | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.