Skip to content

Commit 94138a7

Browse files
committed
get changelog from platform
1 parent bd098d4 commit 94138a7

File tree

4 files changed

+17
-88
lines changed

4 files changed

+17
-88
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
PROPERTIES="$(./gradlew properties --console=plain -q)"
6666
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
6767
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
68-
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
68+
CHANGELOG="$(./gradlew getPluginChangelog --console=plain -q)"
6969
CHANGELOG="${CHANGELOG//'%'/'%25'}"
7070
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
7171
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"

.github/workflows/release.yml

-46
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,6 @@ jobs:
2828
java-version: 11
2929
cache: gradle
3030

31-
# Set environment variables
32-
- name: Export Properties
33-
id: properties
34-
shell: bash
35-
run: |
36-
CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d'
37-
${{ github.event.release.body }}
38-
EOM
39-
)"
40-
41-
CHANGELOG="${CHANGELOG//'%'/'%25'}"
42-
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
43-
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
44-
45-
echo "::set-output name=changelog::$CHANGELOG"
46-
47-
# Update Unreleased section with the current release note
48-
- name: Patch Changelog
49-
if: ${{ steps.properties.outputs.changelog != '' }}
50-
env:
51-
CHANGELOG: ${{ steps.properties.outputs.changelog }}
52-
run: |
53-
./gradlew patchChangelog --release-note="$CHANGELOG"
54-
5531
# Publish the plugin to the Marketplace
5632
- name: Publish Plugin
5733
env:
@@ -63,25 +39,3 @@ jobs:
6339
env:
6440
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6541
run: gh release upload ${{ github.event.release.tag_name }} ./plugin/build/distributions/*
66-
67-
# Create pull request
68-
- name: Create Pull Request
69-
if: ${{ steps.properties.outputs.changelog != '' }}
70-
env:
71-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
run: |
73-
VERSION="${{ github.event.release.tag_name }}"
74-
BRANCH="changelog-update-$VERSION"
75-
76-
git config user.email "[email protected]"
77-
git config user.name "GitHub Action"
78-
79-
git checkout -b $BRANCH
80-
git commit -am "Changelog update - $VERSION"
81-
git push --set-upstream origin $BRANCH
82-
83-
gh pr create \
84-
--title "Changelog update - \`$VERSION\`" \
85-
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
86-
--base master \
87-
--head $BRANCH

plugin/CHANGELOG.md

-40
This file was deleted.

plugin/build.gradle.kts

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.jetbrains.changelog.markdownToHTML
2+
import java.net.URL
23

34
plugins {
45
id("java")
@@ -116,7 +117,12 @@ tasks {
116117
)
117118

118119
// Get the latest available change notes from the changelog file
119-
changeNotes.set(changelog.getLatest().toHTML())
120+
val changelog = URL("https://raw.githubusercontent.com/sourceplusplus/live-platform/master/CHANGELOG.md")
121+
.readText()
122+
.substringAfter("### [JetBrains Plugin](https://github.com/sourceplusplus/interface-jetbrains)\n")
123+
.substringBefore("\n### ").substringBefore("\n## ")
124+
.trim()
125+
changeNotes.set(markdownToHTML(changelog))
120126
}
121127

122128
publishPlugin {
@@ -130,6 +136,15 @@ tasks {
130136
}
131137

132138
tasks {
139+
register("getPluginChangelog") {
140+
val changelog = URL("https://raw.githubusercontent.com/sourceplusplus/live-platform/master/CHANGELOG.md")
141+
.readText()
142+
.substringAfter("### [JetBrains Plugin](https://github.com/sourceplusplus/interface-jetbrains)\n")
143+
.substringBefore("\n### ").substringBefore("\n## ")
144+
.trim()
145+
println(changelog)
146+
}
147+
133148
test {
134149
useJUnitPlatform()
135150
}

0 commit comments

Comments
 (0)