From 7016625a09837839e28ce4bd090136585c814938 Mon Sep 17 00:00:00 2001 From: vldf Date: Wed, 30 Jul 2025 11:28:09 +0300 Subject: [PATCH 1/5] add release GH action --- .github/workflows/release.yml | 110 ++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..599c599 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,110 @@ +# GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow. +# Running the publishPlugin task requires all the following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN. +# See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information. + +name: Release +on: + release: + types: [prereleased, released] + +jobs: + + # Prepare and publish the plugin to JetBrains Marketplace repository + release: + name: Publish Plugin + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@v1.3.1 + with: + tool-cache: false + large-packages: false + + # Check out the current repository + - name: Fetch Sources + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + + # Set up the Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 21 + + # Setup Gradle + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + 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 != '' }} + env: + CHANGELOG: ${{ steps.properties.outputs.changelog }} + run: | + ./gradlew patchChangelog --release-note="$CHANGELOG" + + # Publish the plugin to JetBrains Marketplace +# - name: Publish Plugin +# env: +# PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} +# CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} +# PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} +# PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} +# run: ./gradlew publishPlugin + + # Upload an artifact as a release asset + - name: Upload Release Asset + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* + + # Create a pull request + - name: Create Pull Request + if: ${{ steps.properties.outputs.changelog != '' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + VERSION="${{ github.event.release.tag_name }}" + BRANCH="changelog-update-$VERSION" + LABEL="release changelog" + + git config user.email "action@github.com" + git config user.name "GitHub Action" + + git checkout -b $BRANCH + git commit -am "Changelog update - $VERSION" + git push --set-upstream origin $BRANCH + + gh label create "$LABEL" \ + --description "Pull requests with release changelog update" \ + --force \ + || true + + gh pr create \ + --title "Changelog update - \`$VERSION\`" \ + --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \ + --label "$LABEL" \ + --head $BRANCH From 221e3087fa8f5a23c47e8a261eab23d55a47b1e8 Mon Sep 17 00:00:00 2001 From: vldf Date: Wed, 30 Jul 2025 11:52:09 +0300 Subject: [PATCH 2/5] build a plugin when release --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 599c599..47cd9a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,6 +75,10 @@ jobs: # PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} # run: ./gradlew publishPlugin + - name: Build the Plugin + run: | + ./gradlew buildPlugin + # Upload an artifact as a release asset - name: Upload Release Asset env: From ebcf5ef92e9eb0aff1a658c1979ce2eb984225cd Mon Sep 17 00:00:00 2001 From: vldf Date: Wed, 30 Jul 2025 12:26:07 +0300 Subject: [PATCH 3/5] make minor changes --- .github/workflows/release.yml | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47cd9a2..5d546aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,10 @@ -# GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow. -# Running the publishPlugin task requires all the following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN. -# See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information. - name: Release on: release: - types: [prereleased, released] - + types: [released] jobs: - # Prepare and publish the plugin to JetBrains Marketplace repository + # Prepare and publish the GitHub releases release: name: Publish Plugin runs-on: ubuntu-latest @@ -66,15 +61,7 @@ jobs: run: | ./gradlew patchChangelog --release-note="$CHANGELOG" - # Publish the plugin to JetBrains Marketplace -# - name: Publish Plugin -# env: -# PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} -# CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} -# PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} -# PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} -# run: ./gradlew publishPlugin - + # Build the plugin artifact - name: Build the Plugin run: | ./gradlew buildPlugin From a60acd922f219881c1b17fe8ded31bee6722e404 Mon Sep 17 00:00:00 2001 From: vldf Date: Mon, 18 Aug 2025 11:39:50 +0300 Subject: [PATCH 4/5] remove changelog update --- .github/workflows/release.yml | 36 ----------------------------------- 1 file changed, 36 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d546aa..244aa80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,14 +53,6 @@ jobs: 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 != '' }} - env: - CHANGELOG: ${{ steps.properties.outputs.changelog }} - run: | - ./gradlew patchChangelog --release-note="$CHANGELOG" - # Build the plugin artifact - name: Build the Plugin run: | @@ -71,31 +63,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* - - # Create a pull request - - name: Create Pull Request - if: ${{ steps.properties.outputs.changelog != '' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - VERSION="${{ github.event.release.tag_name }}" - BRANCH="changelog-update-$VERSION" - LABEL="release changelog" - - git config user.email "action@github.com" - git config user.name "GitHub Action" - - git checkout -b $BRANCH - git commit -am "Changelog update - $VERSION" - git push --set-upstream origin $BRANCH - - gh label create "$LABEL" \ - --description "Pull requests with release changelog update" \ - --force \ - || true - - gh pr create \ - --title "Changelog update - \`$VERSION\`" \ - --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \ - --label "$LABEL" \ - --head $BRANCH From e69f2ab257c5bb99291a6495b8d412be9a00b455 Mon Sep 17 00:00:00 2001 From: vldf Date: Mon, 18 Aug 2025 11:42:21 +0300 Subject: [PATCH 5/5] update release.yml workflow --- .github/workflows/release.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 244aa80..7837ec2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,20 +39,6 @@ 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 - # Build the plugin artifact - name: Build the Plugin run: |