在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:BreadMoirai/github-release-gradle-plugin开源软件地址:https://github.com/BreadMoirai/github-release-gradle-plugin开源编程语言:Groovy 95.9%开源软件介绍:github-releaseA Gradle Plugin to send Releases to Github This plugin is not endorsed by Github. This plugin uses OkHttp to send a POST requests to the github api that creates a release and uploads specified assets. Known IssuesIf you are using multiple GithubRelease tasks to compose a single release, the release must be published Changelog2.3.7
2.2.12
2.2.11
2.2.10
2.2.9
2.2.8
2.2.7
2.2.6
2.2.5
2.2.4
2.2.3
2.2.2
2.2.1 2.2.0
Adding as a dependencyUsing the plugins DSL: plugins {
id "com.github.breadmoirai.github-release" version "2.3.7"
} Using legacy plugin application: buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.breadmoirai:github-release:2.3.7"
}
}
apply plugin: "com.github.breadmoirai.github-release" Using this plugingithubRelease {
token "<your token>" // This is your personal access token with Repo permissions
// You get this from your user settings > developer settings > Personal Access Tokens
owner.set "breadmoirai" // default is the last part of your group. Eg group: "com.github.breadmoirai" => owner: "breadmoirai"
repo.set "github-release" // by default this is set to your project name
tagName.set "v1.0.0" // by default this is set to "v${project.version}"
targetCommitish.set "main" // by default this is set to "main"
releaseName.set "v1.0.0" // Release title, by default this is the same as the tagName
body.set "" // by default this is empty
draft.set true // by default this is true
prerelease.set false // by default this is false
releaseAssets jar.destinationDir.listFiles // this points to which files you want to upload as assets with your release, by default this is empty
allowUploadToExisting.set false // Setting this to true will allow this plugin to upload artifacts to a release if it found an existing one. If overwrite is set to true, this option is ignored.
overwrite.set false // by default false; if set to true, will delete an existing release with the same tag and name
dryRun.set false // by default false; you can use this to see what actions would be taken without making a release
apiEndpoint.set "https://api.github.com" // should only change for github enterprise users
client // This is the okhttp client used for http requests
} View more information on each field at the WIKI For additional info on these fields please see the Github API specification. Additional Tips:You can use a provider with a closure to defer evaluation. body provider({
//do something intensive
return "wow"
}) Body ChangelogThis plugin also provides a way to retrieve a list of commits since your last release. This uses the commandline to call git body provider(changelog())
// or
body provider { """\
## CHANGELOG
${changelog().call()}
""" } The changelog can be modified as follows body provider(changelog {
currentCommit "HEAD"
lastCommit "HEAD~10"
options(["--format=oneline", "--abbrev-commit", "--max-count=50", "graph"])
}) You can also apply string operations to the result. body provider({ """\
# Info
...
## ChangeLog
${changelog().call().replace('\n', '\n* ')}
""" }) TokenYou can store your token in a gradle.properties located in either Release AssetsYou can avoid removing irrelevant files from your selected directory each time you publish a release by using a filter. For Example FilenameFilter filter = { dir, filename -> filename.contains(project.version) }
releaseAssets jar.destinationDir.asFileTree.listFiles filter
// or
releaseAssets jar.archiveFile |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论