Skip to content

Commit ba0c678

Browse files
committed
Format the plugin version in build.gradle.kts and set the release version.
1 parent fabbc92 commit ba0c678

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
5252
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
5353
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
54-
run: ./gradlew publishPlugin -Pversion=${{ github.event.release.tag_name }}
54+
run: ./gradlew publishPlugin
5555

5656
# Upload artifact as a release asset
5757
- name: Upload Release Asset

build.gradle.kts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ dependencies {
9898

9999
intellijPlatform {
100100
pluginConfiguration {
101-
version = providers.gradleProperty("pluginVersion")
101+
version = providers.gradleProperty("pluginVersion").map { it.substringBefore('-', "") }
102102
description =
103103
providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
104104
val start = "<!-- Plugin description -->"
@@ -114,16 +114,19 @@ intellijPlatform {
114114

115115
val changelog = project.changelog
116116
changeNotes =
117-
providers.gradleProperty("pluginVersion").map { pluginVersion ->
118-
with(changelog) {
119-
renderItem(
120-
(getOrNull(pluginVersion) ?: getUnreleased())
121-
.withHeader(false)
122-
.withEmptySections(false),
123-
Changelog.OutputType.HTML,
124-
)
117+
providers
118+
.gradleProperty("pluginVersion")
119+
.map { it.substringBefore('-', "") }
120+
.map { pluginVersion ->
121+
with(changelog) {
122+
renderItem(
123+
(getOrNull(pluginVersion) ?: getUnreleased())
124+
.withHeader(false)
125+
.withEmptySections(false),
126+
Changelog.OutputType.HTML,
127+
)
128+
}
125129
}
126-
}
127130

128131
ideaVersion {
129132
sinceBuild = providers.gradleProperty("pluginSinceBuild")
@@ -138,6 +141,8 @@ intellijPlatform {
138141
}
139142

140143
publishing {
144+
// TODO: During release, refrain from reformatting the version number.
145+
// Instead, set the release version before tagging to allow releases to any chosen channel.
141146
token = providers.environmentVariable("PUBLISH_TOKEN")
142147
version =
143148
providers.gradleProperty("pluginVersion").map { it.substringBefore('-', "") }

0 commit comments

Comments
 (0)