xpipe/jreleaser.gradle

87 lines
2.6 KiB
Groovy
Raw Normal View History

2022-06-18 10:29:41 +12:00
def isPreRelease = project.version.endsWith('-pre')
def isFullRelease = !isPreRelease && !project.version.endsWith('-SNAPSHOT')
def proj = project
2022-06-18 11:17:08 +12:00
def canonicalVersion = file('misc/canonical_version').text
2022-06-18 10:29:41 +12:00
jreleaser {
environment {
2022-06-18 11:17:08 +12:00
properties.put('rawChangelog', file("misc/changelogs/${canonicalVersion}.txt").exists() ?
file("misc/changelogs/${canonicalVersion}.txt").text.replace('\r\n', '\n') : "")
2022-06-18 10:29:41 +12:00
}
project {
2022-06-18 11:17:08 +12:00
name = 'X-Pipe Java'
description = '<TODO>'
longDescription = '<TODO>'
website = 'https://github.com/xpipe-io/xpipe_java'
2022-06-18 10:29:41 +12:00
authors = ['Christopher Schnick']
2022-06-18 11:17:08 +12:00
license = 'MIT'
copyright = '2022, Christopher Schnick'
2022-06-18 10:29:41 +12:00
java {
2022-06-18 11:17:08 +12:00
groupId = 'io.xpipe'
2022-06-18 10:29:41 +12:00
version = '17'
multiProject = true
}
snapshot {
enabled = true
pattern = '.*-SNAPSHOT'
label = 'early-access'
}
}
release {
github {
skipRelease = !isFullRelease && !isPreRelease
skipTag = !isFullRelease && !isPreRelease
2022-06-18 11:17:08 +12:00
owner = 'xpipe-io'
2022-06-18 10:29:41 +12:00
overwrite = false
tagName = '{{projectVersion}}'
releaseName = '{{tagName}}'
2022-06-18 11:17:08 +12:00
token = proj.hasProperty("XPIPE_GITHUB_TOKEN") ? proj.property("XPIPE_GITHUB_TOKEN") : System.getenv("XPIPE_GITHUB_TOKEN")
2022-06-18 10:29:41 +12:00
files = true
artifacts = true
checksums = false
signatures = false
// Always set a pre-release, as drafts do not fully work
prerelease {
enabled = true
pattern = '.*'
}
update {
enabled = true
section('ASSETS')
section('TITLE')
section('BODY')
}
changelog {
enabled = true
formatted = 'ALWAYS'
contentTemplate = isFullRelease ? file('misc/github_full.tpl') : file('misc/github_pre.tpl')
}
}
}
distributions {
2022-06-18 11:17:08 +12:00
api {
artifact {
distributionType = 'SINGLE_JAR'
path = 'api/build/libs/api-{{version}}.jar'
transform = 'build/xpipe-api-{{version}}.jar'
2022-06-18 10:29:41 +12:00
}
}
}
announce {
discord {
2022-06-18 11:17:08 +12:00
active = 'RELEASE'
webhook = proj.hasProperty("XPIPE_DISCORD_WEBHOOK") ? proj.property("XPIPE_DISCORD_WEBHOOK") : System.getenv("XPIPE_DISCORD_WEBHOOK")
2022-06-18 10:29:41 +12:00
messageTemplate = isFullRelease ? 'misc/discord_full.tpl' : 'misc/discord_pre.tpl'
}
}
}