mirror of
https://github.com/InsanusMokrassar/SDI.git
synced 2024-11-23 10:38:52 +00:00
add github release plugin
This commit is contained in:
parent
dc9fd28553
commit
991e58cd29
@ -9,6 +9,7 @@ buildscript {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version"
|
||||
classpath "com.github.breadmoirai:github-release:$github_release_plugin_version"
|
||||
}
|
||||
}
|
||||
|
||||
|
24
changelog_parser.sh
Normal file
24
changelog_parser.sh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
function parse() {
|
||||
version="$1"
|
||||
|
||||
while IFS= read -r line && [ -z "`echo "$line" | grep -e "^#\+ $version"`" ]
|
||||
do
|
||||
: # do nothing
|
||||
done
|
||||
|
||||
while IFS= read -r line && [ -z "`echo "$line" | grep -e "^#\+"`" ]
|
||||
do
|
||||
echo "$line"
|
||||
done
|
||||
}
|
||||
|
||||
version="$1"
|
||||
file="$2"
|
||||
|
||||
if [ -n "$file" ]; then
|
||||
parse "$version" < "$file"
|
||||
else
|
||||
parse "$version"
|
||||
fi
|
30
github_release.gradle
Normal file
30
github_release.gradle
Normal file
@ -0,0 +1,30 @@
|
||||
private String getCurrentVersionChangelog() {
|
||||
OutputStream changelogDataOS = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine 'chmod', "+x", './changelog_parser.sh'
|
||||
}
|
||||
exec {
|
||||
standardOutput = changelogDataOS
|
||||
commandLine './changelog_parser.sh', "${project.version}", 'CHANGELOG.md'
|
||||
}
|
||||
|
||||
return changelogDataOS.toString().trim()
|
||||
}
|
||||
|
||||
if (new File(projectDir, "secret.gradle").exists()) {
|
||||
apply from: './secret.gradle'
|
||||
apply plugin: "com.github.breadmoirai.github-release"
|
||||
|
||||
githubRelease {
|
||||
token "${project.property('GITHUB_RELEASE_TOKEN')}"
|
||||
|
||||
owner "InsanusMokrassar"
|
||||
repo "SDI"
|
||||
|
||||
tagName "${project.version}"
|
||||
releaseName "${project.version}"
|
||||
targetCommitish "${project.version}"
|
||||
|
||||
body getCurrentVersionChangelog()
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ kotlin.code.style=official
|
||||
kotlin_version=1.3.72
|
||||
kotlin_serialisation_runtime_version=0.20.0
|
||||
|
||||
gradle_bintray_plugin_version=1.8.4
|
||||
gradle_bintray_plugin_version=1.8.5
|
||||
github_release_plugin_version=2.2.12
|
||||
|
||||
kotlin.incremental.multiplatform=true
|
||||
|
Loading…
Reference in New Issue
Block a user