-
Notifications
You must be signed in to change notification settings - Fork 328
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 #671 from ancho/feature/maven-central-publishing
publish to sonatype nexus instead of bintray
- Loading branch information
Showing
7 changed files
with
88 additions
and
132 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
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,29 @@ | ||
rootProject.ext { | ||
githubToken = project.hasProperty("github.token") ? project.getProperty("github.token") : System.getenv("GITHUBTOKEN") | ||
githubReleaseOwner = project.hasProperty("github.release.owner") ? getProperty("github.release.owner") : System.getenv("GITHUB_RELEASE_OWNER") | ||
githubReleaseRepo = project.hasProperty("github.release.repo") ? getProperty("github.release.repo") : System.getenv("GITHUB_RELEASE_REPO") | ||
githubReleaseDryRun = System.getenv("GITHUB_RELEASE_DRY_RUN") ?: false | ||
} | ||
|
||
afterEvaluate { | ||
def name = project(':jbake-dist').tasks.getByName("distZip").archiveName | ||
def files = project(':jbake-dist').tasks.getByName("distZip").outputs.files.files | ||
if (!project.hasProperty('skipSigning')) { | ||
def signatureFile = project(':jbake-dist').tasks.getByName("signArchives").outputs.files.files.find { it.name.contains(name) } | ||
files << signatureFile | ||
} | ||
|
||
githubRelease { | ||
token "$rootProject.githubToken" // This is your personal access token with Repo permissions | ||
// You get this from your user settings > developer settings > Personal Access Tokens | ||
owner "$rootProject.githubReleaseOwner" | ||
// default is the last part of your group. Eg group: "com.github.breadmoirai" => owner: "breadmoirai" | ||
repo "$rootProject.githubReleaseRepo" // by default this is set to your project name | ||
targetCommitish "master" // by default this is set to "master" | ||
draft false // by default this is false | ||
releaseAssets files | ||
// this points to which files you want to upload as assets with your release | ||
dryRun rootProject.githubReleaseDryRun as boolean | ||
// by default false; you can use this to see what actions would be taken without making a release | ||
} | ||
} |
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,103 +1,6 @@ | ||
apply plugin: 'com.jfrog.bintray' | ||
|
||
ext.bintrayUsername = project.hasProperty('bintrayUsername') ? bintrayUsername : '' | ||
ext.bintrayKey = project.hasProperty('bintrayKey') ? bintrayKey : '' | ||
|
||
/* | ||
UGLY HACK to workaround gradle-bintray-plugin compatibility with Gradle 5+ | ||
https://github.com/asciidoctor/asciidoctorj/issues/861 | ||
https://github.com/bintray/gradle-bintray-plugin/issues/300 | ||
WARNING: since the Groovy Gradle API is modified, this breaks build isolation when sharing a common Gradle daemon instance | ||
This works because gradle-bintray-plugin is using Groovy dynamic compilation hence it is affected by Groovy runtime meta-programming | ||
Tested with: Gradle 5.6.3 / gradle-bintray-plugin 1.8.4 | ||
TODO: remove as soon as bintray/gradle-bintray-plugin#300 is fixed and integrated | ||
*/ | ||
Signature.metaClass.getToSignArtifact = { -> | ||
return (delegate as Signature).source | ||
} | ||
|
||
if (project.name == "jbake-dist") { | ||
|
||
/** | ||
* jbake-dist specific bintray configuration. | ||
* | ||
* We just need the distribution packages from the project with signatures if they are present. | ||
* Notice the repository. It's a generic one. You can configure it with -PbintrayBinaryRepo=whatever | ||
*/ | ||
bintray { | ||
user = bintrayUsername | ||
key = bintrayKey | ||
|
||
if (!project.hasProperty('skipSigning')) { | ||
filesSpec { | ||
from distZip | ||
from distTar | ||
from signArchives.signatureFiles.filter { !it.name.endsWith(".jar.asc") } | ||
|
||
into "." | ||
} | ||
|
||
_bintrayRecordingCopy.dependsOn signArchives | ||
|
||
} else { | ||
filesSpec { | ||
from distZip | ||
from distTar | ||
|
||
into "." | ||
} | ||
} | ||
|
||
dryRun = bintrayDryRun.toBoolean() | ||
|
||
pkg { | ||
userOrg = bintrayOrg | ||
repo = bintrayBinaryRepo | ||
name = applicationName | ||
desc = project.description | ||
licenses = ['MIT'] | ||
labels = ['jbake', 'site-generator'] | ||
websiteUrl = project.website | ||
issueTrackerUrl = project.issues | ||
vcsUrl = project.vcs | ||
publicDownloadNumbers = true | ||
} | ||
nexusPublishing { | ||
repositories { | ||
sonatype() | ||
} | ||
|
||
} else { | ||
|
||
bintray { | ||
user = bintrayUsername | ||
key = bintrayKey | ||
publications = ['mavenJava'] | ||
|
||
if (!project.hasProperty('skipSigning')) { | ||
filesSpec { | ||
from("${buildDir}/libs") { | ||
include '*.jar.asc' | ||
} | ||
from("${buildDir}/publications/mavenJava") { | ||
include 'pom-default.xml.asc' | ||
rename 'pom-default.xml.asc', "${project.name}-${project.version}.pom.asc" | ||
} | ||
into "." | ||
} | ||
} | ||
|
||
dryRun = bintrayDryRun.toBoolean() | ||
pkg { | ||
userOrg = bintrayOrg | ||
repo = bintrayRepo | ||
name = project.name | ||
desc = project.description | ||
licenses = ['MIT'] | ||
labels = ['jbake', 'site-generator'] | ||
websiteUrl = project.website | ||
issueTrackerUrl = project.issues | ||
vcsUrl = project.vcs | ||
publicDownloadNumbers = 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
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