1- # GitHub Actions Workflow created for handling the release process based on the draft release prepared
2- # with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided.
1+ # GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow.
2+ # Running the publishPlugin task requires all following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN.
3+ # See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information.
34
45name : Release
56on :
89
910jobs :
1011
11- # Prepare and publish the plugin to the Marketplace repository
12+ # Prepare and publish the plugin to JetBrains Marketplace repository
1213 release :
1314 name : Publish Plugin
1415 runs-on : ubuntu-latest
16+ permissions :
17+ contents : write
18+ pull-requests : write
1519 steps :
1620
17- # Check out current repository
21+ # Check out the current repository
1822 - name : Fetch Sources
19- uses : actions/checkout@v2.4.0
23+ uses : actions/checkout@v4
2024 with :
2125 ref : ${{ github.event.release.tag_name }}
2226
23- # Setup Java 11 environment for the next steps
27+ # Set up Java environment for the next steps
2428 - name : Setup Java
25- uses : actions/setup-java@v2
29+ uses : actions/setup-java@v4
2630 with :
2731 distribution : zulu
28- java-version : 11
29- cache : gradle
32+ java-version : 17
33+
34+ # Setup Gradle
35+ - name : Setup Gradle
36+ uses : gradle/actions/setup-gradle@v4
3037
3138 # Set environment variables
3239 - name : Export Properties
@@ -38,24 +45,25 @@ jobs:
3845 EOM
3946 )"
4047
41- CHANGELOG="${CHANGELOG//'%'/'%25'}"
42- CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
43- CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
44-
45- echo "::set-output name=changelog::$CHANGELOG"
48+ echo "changelog<<EOF" >> $GITHUB_OUTPUT
49+ echo "$CHANGELOG" >> $GITHUB_OUTPUT
50+ echo "EOF" >> $GITHUB_OUTPUT
4651
47- # Update Unreleased section with the current release note
52+ # Update the Unreleased section with the current release note
4853 - name : Patch Changelog
4954 if : ${{ steps.properties.outputs.changelog != '' }}
5055 env :
5156 CHANGELOG : ${{ steps.properties.outputs.changelog }}
5257 run : |
5358 ./gradlew patchChangelog --release-note="$CHANGELOG"
5459
55- # Publish the plugin to the Marketplace
60+ # Publish the plugin to JetBrains Marketplace
5661 - name : Publish Plugin
5762 env :
5863 PUBLISH_TOKEN : ${{ secrets.PUBLISH_TOKEN }}
64+ CERTIFICATE_CHAIN : ${{ secrets.CERTIFICATE_CHAIN }}
65+ PRIVATE_KEY : ${{ secrets.PRIVATE_KEY }}
66+ PRIVATE_KEY_PASSWORD : ${{ secrets.PRIVATE_KEY_PASSWORD }}
5967 run : ./gradlew publishPlugin
6068
6169 # Upload artifact as a release asset
@@ -64,24 +72,30 @@ jobs:
6472 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6573 run : gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
6674
67- # Create pull request
75+ # Create a pull request
6876 - name : Create Pull Request
6977 if : ${{ steps.properties.outputs.changelog != '' }}
7078 env :
7179 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7280 run : |
7381 VERSION="${{ github.event.release.tag_name }}"
7482 BRANCH="changelog-update-$VERSION"
83+ LABEL="release changelog"
7584
7685 git config user.email "action@github.com"
7786 git config user.name "GitHub Action"
7887
7988 git checkout -b $BRANCH
8089 git commit -am "Changelog update - $VERSION"
8190 git push --set-upstream origin $BRANCH
91+
92+ gh label create "$LABEL" \
93+ --description "Pull requests with release changelog update" \
94+ --force \
95+ || true
8296
8397 gh pr create \
8498 --title "Changelog update - \`$VERSION\`" \
8599 --body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
86- --base main \
100+ --label "$LABEL" \
87101 --head $BRANCH
0 commit comments