diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc09de6..1548480 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,9 +30,6 @@ jobs: build: name: Build runs-on: ubuntu-latest - outputs: - version: ${{ steps.properties.outputs.version }} - changelog: ${{ steps.properties.outputs.changelog }} steps: # Free GitHub Actions Environment Disk Space @@ -57,20 +54,6 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - # Set environment variables - - name: Export Properties - id: properties - shell: bash - run: | - PROPERTIES="$(./gradlew properties --console=plain -q)" - VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" - CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" - - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "changelog<> $GITHUB_OUTPUT - echo "$CHANGELOG" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - # Build plugin - name: Build plugin run: ./gradlew buildPlugin @@ -253,10 +236,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release create "v${{ needs.build.outputs.version }}" \ + VERSION=$(./gradlew properties --property version --quiet --console=plain | tail -n 1 | cut -f2- -d ' ') + RELEASE_NOTE="./build/tmp/release_note.txt" + ./gradlew getChangelog --unreleased --no-header --quiet --console=plain --output-file=$RELEASE_NOTE + + gh release create $VERSION \ --draft \ - --title "v${{ needs.build.outputs.version }}" \ - --notes "$(cat << 'EOM' - ${{ needs.build.outputs.changelog }} - EOM - )" + --title $VERSION \ + --notes-file $RELEASE_NOTE diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dc6b26a..7a59e9f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,27 +44,17 @@ jobs: with: cache-read-only: true - # Set environment variables - - name: Export Properties - id: properties - shell: bash - run: | - CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d' - ${{ github.event.release.body }} - EOM - )" - - echo "changelog<> $GITHUB_OUTPUT - echo "$CHANGELOG" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - # Update the Unreleased section with the current release note - name: Patch Changelog - if: ${{ steps.properties.outputs.changelog != '' }} + if: ${{ github.event.release.body != '' }} env: - CHANGELOG: ${{ steps.properties.outputs.changelog }} + CHANGELOG: ${{ github.event.release.body }} run: | - ./gradlew patchChangelog --release-note="$CHANGELOG" + RELEASE_NOTE="./build/tmp/release_note.txt" + echo "$CHANGELOG" > $RELEASE_NOTE + + ${{ github.event.release.body }} + ./gradlew patchChangelog --release-note-file=$RELEASE_NOTE # Publish the plugin to JetBrains Marketplace - name: Publish Plugin diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d9737a..31b17fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Changed +- GitHub Actions: simplify changelog handling - Dependencies - upgrade `org.jetbrains.changelog` to `2.4.0` ## [2.2.0] - 2025-08-05