Skip to content

Commit

Permalink
Add plugin to sync changelog to Github releases. (#713)
Browse files Browse the repository at this point in the history
Trigger related task with "publishNewRelease" task.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
  • Loading branch information
Tapchicoma authored Apr 22, 2020
1 parent 7ec68bc commit cb0595b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.70' apply false
id 'com.vanniktech.maven.publish' version '0.8.0' apply false
id 'com.github.breadmoirai.github-release' version '2.2.12'
}

ext.versions = [
Expand Down Expand Up @@ -75,6 +76,19 @@ String getGithubToken() {
}
}

githubRelease {
token getGithubToken()
owner "pinterest"
repo "ktlint"
overwrite true
dryRun false
body {
def changelog = project.file("CHANGELOG.md").text
changelog = changelog.substring(changelog.indexOf("## "))
changelog.substring(0, changelog.indexOf("## ["))
}
}

// Put "servers.github.privKey" in "$HOME/.gradle/gradle.properties".
def announceTask = tasks.register("announceRelease", Exec.class) { announceTask ->
group = "Help"
Expand All @@ -93,5 +107,5 @@ def announceTask = tasks.register("announceRelease", Exec.class) { announceTask
tasks.register("publishNewRelease", DefaultTask.class) {
group = "Help"
description = "Triggers uploading new archives and publish announcements"
dependsOn announceTask
dependsOn(announceTask, tasks.named("githubRelease"))
}

0 comments on commit cb0595b

Please # to comment.