mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 08:13:49 +00:00
add github release mechanism
This commit is contained in:
parent
04e6c7b574
commit
17c6d4a889
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,3 +8,5 @@ settings.xml
|
||||
.gradle/
|
||||
build/
|
||||
out/
|
||||
|
||||
secret.gradle
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,3 +21,4 @@ repositories {
|
||||
}
|
||||
|
||||
apply from: "./extensions.gradle"
|
||||
apply from: "./github.gradle"
|
||||
|
27
changelog_info_retriever
Normal file
27
changelog_info_retriever
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
function parse() {
|
||||
version=$1
|
||||
|
||||
read -r
|
||||
while [ -z "`echo $REPLY | grep -e "^#\+ $version"`" ]
|
||||
do
|
||||
read -r
|
||||
done
|
||||
|
||||
read -r
|
||||
while [ -z "`echo $REPLY | grep -e "^#\+"`" ]
|
||||
do
|
||||
echo "$REPLY"
|
||||
read -r
|
||||
done
|
||||
}
|
||||
|
||||
version=$1
|
||||
file=$2
|
||||
|
||||
if [ -n "$file" ]; then
|
||||
parse $version < "$file"
|
||||
else
|
||||
parse $version
|
||||
fi
|
27
github_release.gradle
Normal file
27
github_release.gradle
Normal file
@ -0,0 +1,27 @@
|
||||
private String getCurrentVersionChangelog() {
|
||||
OutputStream changelogDataOS = new ByteArrayOutputStream()
|
||||
exec {
|
||||
standardOutput = changelogDataOS
|
||||
commandLine './changelog_info_retriever', "$library_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 "MicroUtils"
|
||||
|
||||
tagName "$library_version"
|
||||
releaseName "$library_version"
|
||||
targetCommitish "$library_version"
|
||||
|
||||
body getCurrentVersionChangelog()
|
||||
}
|
||||
}
|
@ -10,6 +10,7 @@ ktor_version=1.4.1
|
||||
klockVersion=1.12.1
|
||||
|
||||
gradle_bintray_plugin_version=1.8.5
|
||||
github_release_plugin_version=2.2.12
|
||||
|
||||
uuidVersion=0.2.2
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user