Skip to content

Commit 82cddd2

Browse files
committed
Update version plugin graddle
1 parent 19d4af4 commit 82cddd2

15 files changed

+302
-157
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ updates:
1414
directory: "/"
1515
target-branch: "next"
1616
schedule:
17-
interval: "daily"
17+
interval: "daily"

.github/workflows/build.yml

Lines changed: 147 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
1+
# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
22
# - validate Gradle Wrapper,
33
# - run 'test' and 'verifyPlugin' tasks,
44
# - run Qodana inspections,
@@ -16,38 +16,47 @@ name: Build
1616
on:
1717
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
1818
push:
19-
branches: [main, master]
19+
branches: [ main ]
2020
# Trigger the workflow on any pull request
2121
pull_request:
2222

2323
jobs:
2424

25-
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
26-
# Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
27-
# Build plugin and provide the artifact for the next workflow jobs
25+
# Prepare environment and build the plugin
2826
build:
2927
name: Build
3028
runs-on: ubuntu-latest
3129
outputs:
3230
version: ${{ steps.properties.outputs.version }}
3331
changelog: ${{ steps.properties.outputs.changelog }}
32+
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
3433
steps:
3534

35+
# Free GitHub Actions Environment Disk Space
36+
- name: Maximize Build Space
37+
run: |
38+
sudo rm -rf /usr/share/dotnet
39+
sudo rm -rf /usr/local/lib/android
40+
sudo rm -rf /opt/ghc
41+
3642
# Check out current repository
3743
- name: Fetch Sources
38-
uses: actions/checkout@v2.4.0
44+
uses: actions/checkout@v3
3945

4046
# Validate wrapper
4147
- name: Gradle Wrapper Validation
42-
uses: gradle/[email protected].4
48+
uses: gradle/[email protected].6
4349

44-
# Setup Java 11 environment for the next steps
50+
# Setup Java environment for the next steps
4551
- name: Setup Java
46-
uses: actions/setup-java@v2
52+
uses: actions/setup-java@v3
4753
with:
4854
distribution: zulu
49-
java-version: 11
50-
cache: gradle
55+
java-version: 17
56+
57+
# Setup Gradle
58+
- name: Setup Gradle
59+
uses: gradle/gradle-build-action@v2
5160

5261
# Set environment variables
5362
- name: Export Properties
@@ -56,86 +65,171 @@ jobs:
5665
run: |
5766
PROPERTIES="$(./gradlew properties --console=plain -q)"
5867
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
59-
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
6068
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
61-
CHANGELOG="${CHANGELOG//'%'/'%25'}"
62-
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
63-
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
6469
65-
echo "::set-output name=version::$VERSION"
66-
echo "::set-output name=name::$NAME"
67-
echo "::set-output name=changelog::$CHANGELOG"
68-
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
70+
echo "version=$VERSION" >> $GITHUB_OUTPUT
71+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
72+
73+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
74+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
75+
echo "EOF" >> $GITHUB_OUTPUT
6976
7077
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
7178
79+
# Build plugin
80+
- name: Build plugin
81+
run: ./gradlew buildPlugin
82+
83+
# Prepare plugin archive content for creating artifact
84+
- name: Prepare Plugin Artifact
85+
id: artifact
86+
shell: bash
87+
run: |
88+
cd ${{ github.workspace }}/build/distributions
89+
FILENAME=`ls *.zip`
90+
unzip "$FILENAME" -d content
91+
92+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
93+
94+
# Store already-built plugin as an artifact for downloading
95+
- name: Upload artifact
96+
uses: actions/upload-artifact@v3
97+
with:
98+
name: ${{ steps.artifact.outputs.filename }}
99+
path: ./build/distributions/content/*/*
100+
101+
# Run tests and upload a code coverage report
102+
test:
103+
name: Test
104+
needs: [ build ]
105+
runs-on: ubuntu-latest
106+
steps:
107+
108+
# Check out current repository
109+
- name: Fetch Sources
110+
uses: actions/checkout@v3
111+
112+
# Setup Java environment for the next steps
113+
- name: Setup Java
114+
uses: actions/setup-java@v3
115+
with:
116+
distribution: zulu
117+
java-version: 17
118+
119+
# Setup Gradle
120+
- name: Setup Gradle
121+
uses: gradle/gradle-build-action@v2
122+
72123
# Run tests
73124
- name: Run Tests
74-
run: ./gradlew test
125+
run: ./gradlew check
75126

76127
# Collect Tests Result of failed tests
77128
- name: Collect Tests Result
78129
if: ${{ failure() }}
79-
uses: actions/upload-artifact@v2
130+
uses: actions/upload-artifact@v3
80131
with:
81132
name: tests-result
82133
path: ${{ github.workspace }}/build/reports/tests
83134

135+
# Upload Kover report to CodeCov
136+
- name: Upload Code Coverage Report
137+
uses: codecov/codecov-action@v3
138+
with:
139+
files: ${{ github.workspace }}/build/reports/kover/xml/report.xml
140+
141+
# Run Qodana inspections and provide report
142+
inspectCode:
143+
name: Inspect code
144+
needs: [ build ]
145+
runs-on: ubuntu-latest
146+
permissions:
147+
contents: write
148+
checks: write
149+
pull-requests: write
150+
steps:
151+
152+
# Check out current repository
153+
- name: Fetch Sources
154+
uses: actions/checkout@v3
155+
156+
# Setup Java environment for the next steps
157+
- name: Setup Java
158+
uses: actions/setup-java@v3
159+
with:
160+
distribution: zulu
161+
java-version: 17
162+
163+
# Run Qodana inspections
164+
- name: Qodana - Code Inspection
165+
uses: JetBrains/[email protected]
166+
with:
167+
cache-default-branch-only: true
168+
169+
# Run plugin structure verification along with IntelliJ Plugin Verifier
170+
verify:
171+
name: Verify plugin
172+
needs: [ build, test, inspectCode ]
173+
runs-on: ubuntu-latest
174+
steps:
175+
176+
# Check out current repository
177+
- name: Fetch Sources
178+
uses: actions/checkout@v3
179+
180+
# Setup Java environment for the next steps
181+
- name: Setup Java
182+
uses: actions/setup-java@v3
183+
with:
184+
distribution: zulu
185+
java-version: 17
186+
187+
# Setup Gradle
188+
- name: Setup Gradle
189+
uses: gradle/gradle-build-action@v2
190+
84191
# Cache Plugin Verifier IDEs
85192
- name: Setup Plugin Verifier IDEs Cache
86-
uses: actions/cache@v2.1.7
193+
uses: actions/cache@v3
87194
with:
88-
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
195+
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
89196
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
90197

91198
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
92199
- name: Run Plugin Verification tasks
93-
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
200+
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
94201

95202
# Collect Plugin Verifier Result
96203
- name: Collect Plugin Verifier Result
97204
if: ${{ always() }}
98-
uses: actions/upload-artifact@v2
205+
uses: actions/upload-artifact@v3
99206
with:
100207
name: pluginVerifier-result
101208
path: ${{ github.workspace }}/build/reports/pluginVerifier
102209

103-
# Run Qodana inspections
104-
- name: Qodana - Code Inspection
105-
uses: JetBrains/[email protected]
106-
107-
# Prepare plugin archive content for creating artifact
108-
- name: Prepare Plugin Artifact
109-
id: artifact
110-
shell: bash
111-
run: |
112-
cd ${{ github.workspace }}/build/distributions
113-
FILENAME=`ls *.zip`
114-
unzip "$FILENAME" -d content
115-
116-
echo "::set-output name=filename::${FILENAME:0:-4}"
117-
118-
# Store already-built plugin as an artifact for downloading
119-
- name: Upload artifact
120-
uses: actions/[email protected]
121-
with:
122-
name: ${{ steps.artifact.outputs.filename }}
123-
path: ./build/distributions/content/*/*
124-
125210
# Prepare a draft release for GitHub Releases page for the manual verification
126211
# If accepted and published, release workflow would be triggered
127212
releaseDraft:
128-
name: Release Draft
213+
name: Release draft
129214
if: github.event_name != 'pull_request'
130-
needs: build
215+
needs: [ build, verify ]
131216
runs-on: ubuntu-latest
217+
permissions:
218+
contents: write
132219
steps:
133220

134221
# Check out current repository
135222
- name: Fetch Sources
136-
uses: actions/[email protected]
223+
uses: actions/checkout@v3
224+
225+
# Setup Java environment for the next steps
226+
- name: Setup Java
227+
uses: actions/setup-java@v3
228+
with:
229+
distribution: zulu
230+
java-version: 17
137231

138-
# Remove old release drafts by using the curl request for the available releases with draft flag
232+
# Remove old release drafts by using the curl request for the available releases with a draft flag
139233
- name: Remove Old Release Drafts
140234
env:
141235
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -144,7 +238,7 @@ jobs:
144238
--jq '.[] | select(.draft == true) | .id' \
145239
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
146240
147-
# Create new release draft - which is not publicly visible and requires manual acceptance
241+
# Create a new release draft which is not publicly visible and requires manual acceptance
148242
- name: Create Release Draft
149243
env:
150244
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -155,4 +249,4 @@ jobs:
155249
--notes "$(cat << 'EOM'
156250
${{ needs.build.outputs.changelog }}
157251
EOM
158-
)"
252+
)"

.github/workflows/release.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
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

45
name: Release
56
on:
@@ -12,21 +13,27 @@ jobs:
1213
release:
1314
name: Publish Plugin
1415
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
1519
steps:
1620

1721
# Check out current repository
1822
- name: Fetch Sources
19-
uses: actions/checkout@v2.4.0
23+
uses: actions/checkout@v3
2024
with:
2125
ref: ${{ github.event.release.tag_name }}
2226

23-
# Setup Java 11 environment for the next steps
27+
# Setup Java environment for the next steps
2428
- name: Setup Java
25-
uses: actions/setup-java@v2
29+
uses: actions/setup-java@v3
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/gradle-build-action@v2
3037

3138
# Set environment variables
3239
- name: Export Properties
@@ -38,11 +45,9 @@ 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
4752
# Update Unreleased section with the current release note
4853
- name: Patch Changelog
@@ -56,6 +61,9 @@ jobs:
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
@@ -72,16 +80,21 @@ jobs:
7280
run: |
7381
VERSION="${{ github.event.release.tag_name }}"
7482
BRANCH="changelog-update-$VERSION"
83+
LABEL="release changelog"
7584
7685
git config user.email "[email protected]"
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+
|| true
8295
8396
gh pr create \
8497
--title "Changelog update - \`$VERSION\`" \
8598
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
86-
--base master \
87-
--head $BRANCH
99+
--label "$LABEL" \
100+
--head $BRANCH

0 commit comments

Comments
 (0)