Skip to content

Commit c2f5ed2

Browse files
committed
Release 0.3.1 — attach changelog notes to marketplace upload
Republish of 0.3.0 with release notes wired into the upload. The publishPlugin task now renders the current version's CHANGELOG section via gradle-changelog-plugin and POSTs it as the `notes` form field, so the marketplace listing's "What's new" populates automatically. No code changes; 0.3.0 shipped without notes because the field wasn't set.
1 parent 39ff8bc commit c2f5ed2

3 files changed

Lines changed: 34 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
## [0.3.0]
10+
## [0.3.1]
1111

1212
### Added
1313

build.gradle.kts

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import java.io.ByteArrayOutputStream
22
import org.gradle.process.ExecOperations
3+
import org.jetbrains.changelog.Changelog
34
import javax.inject.Inject
45

56
plugins {
@@ -11,7 +12,7 @@ plugins {
1112

1213
allprojects {
1314
group = "dev.kensa.teamcity"
14-
version = "0.3.0"
15+
version = "0.3.1"
1516
}
1617

1718
changelog {
@@ -118,6 +119,10 @@ abstract class PublishPluginTask : DefaultTask() {
118119
@get:org.gradle.api.tasks.Input
119120
abstract val xmlId: org.gradle.api.provider.Property<String>
120121

122+
@get:org.gradle.api.tasks.Input
123+
@get:org.gradle.api.tasks.Optional
124+
abstract val notes: org.gradle.api.provider.Property<String>
125+
121126
@get:org.gradle.api.tasks.Internal
122127
abstract val publishToken: org.gradle.api.provider.Property<String>
123128

@@ -129,15 +134,20 @@ abstract class PublishPluginTask : DefaultTask() {
129134
require(zip.isFile) { "Signed plugin not found at $zip (run :signPlugin first)" }
130135

131136
val stdout = ByteArrayOutputStream()
137+
val cmd = mutableListOf(
138+
"curl", "-fsSL",
139+
"-X", "POST",
140+
"-H", "Authorization: Bearer $token",
141+
"-F", "xmlId=${xmlId.get()}",
142+
"-F", "file=@${zip.absolutePath}",
143+
)
144+
notes.orNull?.takeIf { it.isNotBlank() }?.let {
145+
cmd += listOf("-F", "notes=$it")
146+
}
147+
cmd += "https://plugins.jetbrains.com/plugin/uploadPlugin"
148+
132149
val result = execOps.exec {
133-
commandLine(
134-
"curl", "-fsSL",
135-
"-X", "POST",
136-
"-H", "Authorization: Bearer $token",
137-
"-F", "xmlId=${xmlId.get()}",
138-
"-F", "file=@${zip.absolutePath}",
139-
"https://plugins.jetbrains.com/plugin/uploadPlugin",
140-
)
150+
commandLine(cmd)
141151
standardOutput = stdout
142152
isIgnoreExitValue = true
143153
}
@@ -158,4 +168,17 @@ tasks.register<PublishPluginTask>("publishPlugin") {
158168
// bare; only the marketplace upload needs the prefix.
159169
xmlId.set("teamcity_kensa-teamcity-plugin")
160170
publishToken.set(providers.environmentVariable("PUBLISH_TOKEN"))
171+
172+
val changelog = project.changelog
173+
val pluginVersion = project.version.toString()
174+
notes.set(provider {
175+
with(changelog) {
176+
renderItem(
177+
(getOrNull(pluginVersion) ?: getUnreleased())
178+
.withHeader(false)
179+
.withEmptySections(false),
180+
Changelog.OutputType.HTML,
181+
)
182+
}
183+
})
161184
}

teamcity-plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<info>
44
<name>kensa-teamcity-plugin</name>
55
<display-name>Kensa Integration</display-name>
6-
<version>0.3.0</version>
6+
<version>0.3.1</version>
77
<description><![CDATA[
88
Surfaces Kensa BDD test reports inside TeamCity.
99

0 commit comments

Comments
 (0)