xpipe/jreleaser.gradle
Christopher Schnick 4dc685f895 Release fixes
2022-06-18 01:17:08 +02:00

86 lines
2.6 KiB
Groovy

def isPreRelease = project.version.endsWith('-pre')
def isFullRelease = !isPreRelease && !project.version.endsWith('-SNAPSHOT')
def proj = project
def canonicalVersion = file('misc/canonical_version').text
jreleaser {
environment {
properties.put('rawChangelog', file("misc/changelogs/${canonicalVersion}.txt").exists() ?
file("misc/changelogs/${canonicalVersion}.txt").text.replace('\r\n', '\n') : "")
}
project {
name = 'X-Pipe Java'
description = '<TODO>'
longDescription = '<TODO>'
website = 'https://github.com/xpipe-io/xpipe_java'
authors = ['Christopher Schnick']
license = 'MIT'
copyright = '2022, Christopher Schnick'
java {
groupId = 'io.xpipe'
version = '17'
multiProject = true
}
snapshot {
enabled = true
pattern = '.*-SNAPSHOT'
label = 'early-access'
}
}
release {
github {
skipRelease = !isFullRelease && !isPreRelease
skipTag = !isFullRelease && !isPreRelease
owner = 'xpipe-io'
overwrite = false
tagName = '{{projectVersion}}'
releaseName = '{{tagName}}'
token = proj.hasProperty("XPIPE_GITHUB_TOKEN") ? proj.property("XPIPE_GITHUB_TOKEN") : System.getenv("XPIPE_GITHUB_TOKEN")
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 {
api {
artifact {
distributionType = 'SINGLE_JAR'
path = 'api/build/libs/api-{{version}}.jar'
transform = 'build/xpipe-api-{{version}}.jar'
}
}
}
announce {
discord {
active = 'RELEASE'
webhook = proj.hasProperty("XPIPE_DISCORD_WEBHOOK") ? proj.property("XPIPE_DISCORD_WEBHOOK") : System.getenv("XPIPE_DISCORD_WEBHOOK")
messageTemplate = isFullRelease ? 'misc/discord_full.tpl' : 'misc/discord_pre.tpl'
}
}
}