-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented migrations: - Bintray -> Sonatype Nexus - Travis -> GH Actions - Shipkit 2.0 -> Shipkit 3.0 (new plugins) Benefits: - enables concurrent releases - migrates off discontinued tech - eliminates version bump commits Co-authored-by: Walaa Eldin Moustafa <[email protected]>
- Loading branch information
1 parent
b655721
commit 636fb8c
Showing
12 changed files
with
203 additions
and
60 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,51 @@ | ||
# | ||
# 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 | ||
pull_request: | ||
branches: ['**'] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
|
||
steps: | ||
|
||
- name: 1. 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: 2. Set up Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
|
||
- name: 3. Perform build | ||
run: ./gradlew build | ||
|
||
- name: 4. 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/coral' | ||
&& !contains(toJSON(github.event.commits.*.message), '[skip release]') | ||
|
||
run: ./gradlew githubRelease publishToSonatype closeAndReleaseStagingRepository | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
SONATYPE_USER: ${{secrets.SONATYPE_USER}} | ||
SONATYPE_PWD: ${{secrets.SONATYPE_PWD}} | ||
PGP_KEY: ${{secrets.PGP_KEY}} | ||
PGP_PWD: ${{secrets.PGP_PWD}} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
apply plugin: 'java' | ||
apply from: "$rootDir/gradle/java-publication.gradle" | ||
apply plugin: 'antlr' | ||
|
||
dependencies { | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
apply plugin: 'java' | ||
apply from: "$rootDir/gradle/java-publication.gradle" | ||
|
||
dependencies { | ||
compile deps.'gson' | ||
|
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
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,96 @@ | ||
apply plugin: "java" | ||
|
||
def licenseSpec = copySpec { | ||
from project.rootDir | ||
include "LICENSE" | ||
} | ||
|
||
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 { | ||
javaLibrary(MavenPublication) { | ||
from components.java | ||
artifact sourcesJar | ||
artifact javadocJar | ||
|
||
artifactId = project.archivesBaseName | ||
|
||
pom { | ||
name = artifactId | ||
description = "A library for analyzing, processing, and rewriting views defined in the Hive Metastore, and sharing them across multiple execution engines" | ||
|
||
url = "https://github.com/linkedin/coral" | ||
licenses { | ||
license { | ||
name = 'The MIT License' | ||
url = 'https://github.com/linkedin/coral/blob/master/LICENSE' | ||
distribution = 'repo' | ||
} | ||
} | ||
developers { | ||
[ | ||
'wmoustafa:Walaa Eldin Moustafa', | ||
'khaitranq:Khai Tranh', | ||
'funcheetah:Wenye Zhang', | ||
'shardulm94:Shardul Mahadik', | ||
'hotsushi:Sushant Raikar' | ||
].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/coral.git' | ||
} | ||
issueManagement { | ||
url = 'https://github.com/linkedin/coral/issues' | ||
system = 'GitHub issues' | ||
} | ||
ciManagement { | ||
url = 'https://travis-ci.com/linkedin/coral' | ||
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("publishJavaLibraryPublicationToMavenLocal") | ||
|
||
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.javaLibrary | ||
} | ||
} |
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,50 +1,31 @@ | ||
shipkit { | ||
gitHub.repository = "linkedin/coral" | ||
//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 | ||
|
||
gitHub.readOnlyAuthToken = "967ad570c37790a939" + "366590ca3035ed56b8d2ae" | ||
|
||
// The GitHub write token is required for committing release notes and bumping up project version | ||
// Ensure that the release machine or Travis CI has this env variable exported | ||
gitHub.writeAuthToken = System.getenv("GH_WRITE_TOKEN") | ||
|
||
git.releasableBranchRegex = "master|release/.+" | ||
|
||
team.developers = [ | ||
'wmoustafa:Walaa Eldin Moustafa', | ||
'khaitranq:Khai Tranh', | ||
'funcheetah:Wenye Zhang', | ||
'shardulm94:Shardul Mahadik', | ||
'hotsushi:Sushant Raikar' | ||
] | ||
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/coral" | ||
} | ||
|
||
allprojects { | ||
plugins.withId("org.shipkit.bintray") { | ||
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") | ||
} | ||
|
||
//Bintray configuration is handled by JFrog Bintray Gradle Plugin | ||
//For reference see the official documentation: https://github.com/bintray/gradle-bintray-plugin | ||
bintray { | ||
// The Bintray API token is required to publish artifacts to Bintray | ||
// Ensure that the release machine or Travis CI has this env variable exported | ||
key = System.getenv("BINTRAY_API_KEY") | ||
pkg { | ||
repo = 'maven' | ||
user = 'lnkd-apa' | ||
userOrg = 'linkedin' | ||
name = 'coral' | ||
licenses = ['BSD 2-Clause'] | ||
labels = [ | ||
'coral', | ||
'sql', | ||
'presto', | ||
'spark', | ||
'hive', | ||
'views' | ||
] | ||
vcsUrl = "https://github.com/linkedin/coral.git" | ||
description = "A library for analyzing, processing, and rewriting views defined in the Hive Metastore, and sharing them across multiple execution engines" | ||
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") | ||
} | ||
publish = true | ||
} | ||
} | ||
} |
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,4 +1,3 @@ | ||
#Version of the produced binaries. This file is intended to be checked-in. | ||
#It will be automatically bumped by release automation. | ||
version=1.0.33 | ||
previousVersion=1.0.32 | ||
# Version of the produced binaries. | ||
# The version is inferred by shipkit-auto-version Gradle plugin (https://github.com/shipkit/shipkit-auto-version) | ||
version=1.0.* |