-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from CWTSLeiden/feature/gradle-build
Use Gradle for building and publishing
- Loading branch information
Showing
96 changed files
with
6,134 additions
and
3,404 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,6 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# These are explicitly windows files and should use crlf | ||
*.bat text eol=crlf | ||
|
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 @@ | ||
# This workflow will build a package using Gradle. | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | ||
|
||
name: Build master branch | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Print version | ||
run: gradle printVersion | ||
- name: Build with Gradle | ||
run: gradle build | ||
- name: Generate sources jar with Gradle | ||
run: gradle sourcesjar | ||
- name: Generate JavaDoc jar with Gradle | ||
run: gradle javadocjar | ||
- name: Upload package as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Package | ||
path: build/libs |
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,29 @@ | ||
# This workflow will build a package using Gradle and then publish it to GitHub Packages and the Maven Central Repository. | ||
# For more information see: https://github.com/actions/setup-java#publishing-using-gradle | ||
|
||
name: Publish package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Build with Gradle | ||
run: gradle build | ||
- name: Publish package to GitHub Packages and the Maven Central Repository | ||
run: gradle publish | ||
env: | ||
GITHUB_ACTOR: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }} |
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 |
---|---|---|
|
@@ -15,4 +15,5 @@ test* | |
bin/ | ||
.classpath | ||
.project | ||
.settings | ||
.settings/ | ||
.gradle/ |
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 @@ | ||
plugins { | ||
id 'java-library' | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'com.palantir.git-version' version '0.12.3' | ||
} | ||
|
||
group = 'nl.cwts' | ||
version = gitVersion() | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes('Implementation-Title': project.name, | ||
'Implementation-Version': project.version) | ||
} | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "GitHubPackages" | ||
url = "https://maven.pkg.github.com/CWTSLeiden/networkanalysis" | ||
credentials { | ||
username = System.getenv("GITHUB_ACTOR") | ||
password = System.getenv("GITHUB_TOKEN") | ||
} | ||
} | ||
maven { | ||
name = "OSSRH" | ||
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
credentials { | ||
username = System.getenv("OSSRH_USERNAME") | ||
password = System.getenv("OSSRH_PASSWORD") | ||
} | ||
} | ||
} | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from components.java | ||
pom { | ||
name = "networkanalysis" | ||
description = "Java package that provides data structures and algorithms for network analysis." | ||
url = "https://github.com/CWTSLeiden/networkanalysis" | ||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = "http://www.opensource.org/licenses/mit-license.php" | ||
} | ||
} | ||
developers { | ||
developer { | ||
name = "Nees Jan van Eck" | ||
email = "ecknjpvan@cwts.leidenuniv.nl" | ||
url = "https://github.com/neesjanvaneck" | ||
id = "neesjanvaneck" | ||
} | ||
developer { | ||
name = "Vincent Traag" | ||
email = "v.a.traag@cwts.leidenuniv.nl" | ||
url = "https://github.com/vtraag" | ||
id = "vtraag" | ||
} | ||
developer { | ||
name = "Ludo Waltman" | ||
email = "waltmanlr@cwts.leidenuniv.nl" | ||
url = "https://github.com/ludowaltman" | ||
id = "ludowaltman" | ||
} | ||
} | ||
scm { | ||
connection = "scm:git@github.com:CWTSLeiden/networkanalysis.git" | ||
developerConnection = "scm:git@github.com:CWTSLeiden/networkanalysis.git" | ||
url = "https://github.com/CWTSLeiden/networkanalysis" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required { gradle.taskGraph.hasTask("publish") } | ||
def signingKey = System.getenv("GPG_SIGNING_KEY") | ||
def signingPassword = System.getenv("GPG_SIGNING_PASSWORD") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign publishing.publications.mavenJava | ||
} |
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
Oops, something went wrong.