-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add jar signing add maven upload and nexus staging tasks add release shell script update to version 0.2.0
- Loading branch information
1 parent
369fad2
commit dfa5432
Showing
5 changed files
with
110 additions
and
10 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 |
---|---|---|
|
@@ -8,3 +8,5 @@ shippable/ | |
*.iml | ||
*.ipr | ||
*.iws | ||
*.asc | ||
*.gpg |
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,6 +1,6 @@ | ||
buildscript { | ||
dependencies { | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.4" | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.0" | ||
} | ||
repositories { | ||
mavenCentral() | ||
|
@@ -10,30 +10,39 @@ buildscript { | |
plugins { | ||
id 'java' | ||
id 'idea' | ||
id "org.jetbrains.kotlin.jvm" version "1.1.4" | ||
id "org.jetbrains.kotlin.jvm" version "1.2.0" | ||
id 'jacoco' | ||
id 'maven' | ||
id 'signing' | ||
id 'io.codearte.nexus-staging' version '0.11.0' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
version = "0.1.0" | ||
ext { | ||
pomFile = file("${project.buildDir}/generated-pom.xml") | ||
isReleaseVersion = !(project.version =~ /-SNAPSHOT$/) | ||
} | ||
|
||
version = "0.2.0" | ||
project.group = "com.github.wakingrufus" | ||
|
||
dependencies { | ||
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8" | ||
compile 'org.projectlombok:lombok:1.16.18' | ||
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' | ||
compile 'org.slf4j:slf4j-api:1.7.25' | ||
compile 'io.github.microutils:kotlin-logging:1.4.4' | ||
compile "org.jetbrains.kotlin:kotlin-reflect" | ||
compile "org.jsoup:jsoup:1.10.3" | ||
|
||
testCompile "org.jetbrains.kotlin:kotlin-test" | ||
testCompile "org.jetbrains.kotlin:kotlin-test-junit" | ||
testCompile 'org.mockito:mockito-core:2.8.9' | ||
testCompile group: 'junit', name: 'junit', version: '4.12' | ||
testCompile 'junit:junit:4.12' | ||
testCompile "com.nhaarman:mockito-kotlin-kt1.1:1.5.0" | ||
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25' | ||
testCompile 'org.slf4j:slf4j-log4j12:1.7.25' | ||
} | ||
|
||
idea { | ||
|
@@ -43,7 +52,7 @@ idea { | |
} | ||
|
||
task wrapper(type: Wrapper) { | ||
gradleVersion = '4.3.1' | ||
gradleVersion = '4.2.1' | ||
} | ||
|
||
jacocoTestReport { | ||
|
@@ -64,4 +73,76 @@ compileTestKotlin { | |
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
artifacts { | ||
archives jar | ||
archives sourcesJar | ||
archives javadocJar | ||
} | ||
|
||
signing { | ||
required { signatory != null && project.ext.isReleaseVersion } | ||
sign configurations.archives | ||
} | ||
|
||
nexusStaging { | ||
packageGroup = "com.github.wakingrufus" | ||
} | ||
|
||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
pom.project { | ||
name 'lib-elo' | ||
packaging 'jar' | ||
group project.group | ||
version project.version | ||
// optionally artifactId can be defined here | ||
description 'A library which performs ELO calculations for a game league (such as chess)' | ||
url 'https://github.com/wakingrufus/lib-elo' | ||
|
||
scm { | ||
connection 'scm:git:https://github.com/wakingrufus/lib-elo.git' | ||
developerConnection 'scm:git:https://github.com/wakingrufus/lib-elo.git/' | ||
url 'https://github.com/wakingrufus/lib-elo' | ||
} | ||
|
||
licenses { | ||
license { | ||
name 'MIT License' | ||
url 'https://opensource.org/licenses/MIT' | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'wakingrufus' | ||
name 'Rufus' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
signing.keyId= | ||
signing.password= | ||
signing.secretKeyRingFile=secring.gpg | ||
|
||
ossrhUsername= | ||
ossrhPassword= |
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,11 @@ | ||
#!/usr/bin/env bash | ||
echo Enter signing key id | ||
read key_id | ||
echo Enter signing key password | ||
read key_pass | ||
gpg2 --export-secret-key $key_id > secring.gpg | ||
echo Enter ossrh Username | ||
read ossrh_username | ||
echo Enter ossrh Password | ||
read ossrh_password | ||
gradle -PossrhUsername=$ossrh_username -PossrhPassword=$ossrh_password -Psigning.keyId=$key_id -Psigning.password=$key_pass signArchives uploadArchives closeAndReleaseRepository |
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