readded release build path
This commit is contained in:
parent
0a160541e2
commit
c0b461d92b
1 changed files with 52 additions and 0 deletions
52
bclib.gradle
52
bclib.gradle
|
@ -80,6 +80,58 @@ artifacts {
|
|||
archives javadocJar
|
||||
}
|
||||
|
||||
def env = System.getenv()
|
||||
|
||||
import org.kohsuke.github.GHReleaseBuilder
|
||||
import org.kohsuke.github.GitHub
|
||||
|
||||
task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
|
||||
onlyIf {
|
||||
env.GITHUB_TOKEN
|
||||
}
|
||||
|
||||
doLast {
|
||||
def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String)
|
||||
def repository = github.getRepository("paulevsGitch/BCLib")
|
||||
|
||||
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
|
||||
releaseBuilder.name("${archivesBaseName}-${version}")
|
||||
releaseBuilder.body("A changelog can be found at https://github.com/paulevsGitch/BCLib/commits")
|
||||
releaseBuilder.commitish("main")
|
||||
|
||||
def ghRelease = releaseBuilder.create()
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive");
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar"), "application/java-archive");
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-javadoc.jar"), "application/java-archive");
|
||||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
gpr(MavenPublication) {
|
||||
artifactId archivesBaseName
|
||||
artifact(remapJar) {
|
||||
builtBy remapJar
|
||||
}
|
||||
artifact(sourcesJar) {
|
||||
builtBy remapSourcesJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// select the repositories you want to publish to
|
||||
repositories {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/paulevsgitch/bclib")
|
||||
credentials {
|
||||
username = env.GITHUB_USER
|
||||
password = env.GITHUB_TOKEN
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
dev {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue