1- # GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
2- # - Validate Gradle Wrapper.
3- # - Run 'test' and 'verifyPlugin' tasks.
4- # - Run Qodana inspections.
5- # - Run the 'buildPlugin' task and prepare artifact for further tests.
6- # - Run the 'runPluginVerifier' task.
7- # - Create a draft release.
8- #
9- # The workflow is triggered on push and pull_request events.
10- #
11- # GitHub Actions reference: https://help.github.com/en/actions
12- #
13- # # JBIJPPTPL
14-
15- name : Build
1+ name : Build and verify. Publish plugin on workflow dispatch
162on :
17- # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
183 push :
19- branches : [ main ]
20- # Trigger the workflow on any pull request
4+ branches :
5+ - main
6+
217 pull_request :
8+ workflow_dispatch :
9+
10+ permissions :
11+ contents : read
2212
2313jobs :
2414
25- # Prepare environment and build the plugin
2615 build :
2716 name : Build
2817 runs-on : ubuntu-latest
@@ -31,29 +20,27 @@ jobs:
3120 changelog : ${{ steps.properties.outputs.changelog }}
3221 pluginVerifierHomeDir : ${{ steps.properties.outputs.pluginVerifierHomeDir }}
3322 steps :
23+ - name : Maximize Build Space
24+ run : |
25+ sudo rm -rf /usr/share/dotnet
26+ sudo rm -rf /usr/local/lib/android
27+ sudo rm -rf /opt/ghc
28+ sudo rm -rf /usr/local/.ghcup
3429
35- # Check out current repository
3630 - name : Fetch Sources
37- uses : actions/checkout@v6
38-
39- # Validate wrapper
40- - name : Gradle Wrapper Validation
41- 31+ uses : actions/checkout@v4
4232
43- # Set up Java environment for the next steps
4433 - name : Setup Java
45- uses : actions/setup-java@v5
34+ uses : actions/setup-java@v3
4635 with :
4736 distribution : zulu
4837 java-version : 17
4938
50- # Setup Gradle
5139 - name : Setup Gradle
52- 40+ uses : gradle/actions/setup-gradle@v4
5341 with :
54- gradle-home-cache-cleanup : true
42+ validate-wrappers : true
5543
56- # Set environment variables
5744 - name : Export Properties
5845 id : properties
5946 shell : bash
@@ -64,18 +51,16 @@ jobs:
6451
6552 echo "version=$VERSION" >> $GITHUB_OUTPUT
6653 echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
67-
54+
6855 echo "changelog<<EOF" >> $GITHUB_OUTPUT
6956 echo "$CHANGELOG" >> $GITHUB_OUTPUT
7057 echo "EOF" >> $GITHUB_OUTPUT
7158
72- ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
59+ ./gradlew printProductsReleases # prepare list of IDEs for Plugin Verifier
7360
74- # Build plugin
7561 - name : Build plugin
7662 run : ./gradlew buildPlugin
7763
78- # Prepare plugin archive content for creating artifact
7964 - name : Prepare Plugin Artifact
8065 id : artifact
8166 shell : bash
@@ -86,166 +71,68 @@ jobs:
8671
8772 echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
8873
89- # Store already-built plugin as an artifact for downloading
9074 - name : Upload artifact
91- uses : actions/upload-artifact@v6
75+ uses : actions/upload-artifact@v4
9276 with :
9377 name : ${{ steps.artifact.outputs.filename }}
9478 path : ./build/distributions/content/*/*
9579
96- # Run tests and upload a code coverage report
97- test :
98- name : Test
99- needs : [ build ]
100- runs-on : ubuntu-latest
101- steps :
102-
103- # Check out current repository
104- - name : Fetch Sources
105- uses : actions/checkout@v6
106-
107- # Set up Java environment for the next steps
108- - name : Setup Java
109- uses : actions/setup-java@v5
110- with :
111- distribution : zulu
112- java-version : 17
113-
114- # Setup Gradle
115- - name : Setup Gradle
116- 117- with :
118- gradle-home-cache-cleanup : true
119-
120- # Run tests
121- - name : Run Tests
122- run : ./gradlew check
123-
124- # Collect Tests Result of failed tests
125- - name : Collect Tests Result
126- if : ${{ failure() }}
127- uses : actions/upload-artifact@v6
128- with :
129- name : tests-result
130- path : ${{ github.workspace }}/build/reports/tests
131-
132- # Upload the Kover report to CodeCov
133- - name : Upload Code Coverage Report
134- uses : codecov/codecov-action@v5
135- with :
136- files : ${{ github.workspace }}/build/reports/kover/report.xml
137-
138- # Run Qodana inspections and provide report
139- inspectCode :
140- name : Inspect code
141- needs : [ build ]
142- runs-on : ubuntu-latest
143- permissions :
144- contents : write
145- checks : write
146- pull-requests : write
147- steps :
148-
149- # Check out current repository
150- - name : Fetch Sources
151- uses : actions/checkout@v6
152-
153- # Set up Java environment for the next steps
154- - name : Setup Java
155- uses : actions/setup-java@v5
156- with :
157- distribution : zulu
158- java-version : 17
159-
160- # Run Qodana inspections
161- - name : Qodana - Code Inspection
162- 163- with :
164- cache-default-branch-only : true
165-
166- # Run plugin structure verification along with IntelliJ Plugin Verifier
16780 verify :
16881 name : Verify plugin
16982 needs : [ build ]
17083 runs-on : ubuntu-latest
17184 steps :
17285
173- # Check out current repository
86+ - name : Maximize Build Space
87+ run : |
88+ sudo docker image prune --all --force || true
89+
90+ sudo rm -rf /usr/share/dotnet
91+ sudo rm -rf /usr/local/lib/android
92+ sudo rm -rf /opt/ghc
93+ sudo rm -rf /usr/local/.ghcup
94+ sudo rm -rf /opt/hostedtoolcache
95+ sudo rm -rf /usr/share/swift
96+ sudo rm -rf /usr/local/share/powershell
97+
98+ sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..."
99+ sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..."
100+ sudo apt-get remove -y '^llvm-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^llvm-.*' --fix-missing] failed to complete successfully. Proceeding..."
101+ sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..."
102+ sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..."
103+ sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..."
104+ sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..."
105+ sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..."
106+ sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..."
107+ sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..."
108+ sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..."
109+
174110 - name : Fetch Sources
175- uses : actions/checkout@v6
111+ uses : actions/checkout@v4
176112
177- # Set up Java environment for the next steps
178113 - name : Setup Java
179- uses : actions/setup-java@v5
114+ uses : actions/setup-java@v3
180115 with :
181116 distribution : zulu
182117 java-version : 17
183118
184- # Setup Gradle
185119 - name : Setup Gradle
186- 120+ uses : gradle/actions/setup-gradle@v4
187121 with :
188- gradle-home-cache-cleanup : true
122+ validate-wrappers : true
189123
190- # Cache Plugin Verifier IDEs
191124 - name : Setup Plugin Verifier IDEs Cache
192- uses : actions/cache@v5
125+ uses : actions/cache@v3
193126 with :
194127 path : ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
195- key : plugin-verifier-${{ hashFiles('build/listProductsReleases .txt') }}
128+ key : plugin-verifier-${{ hashFiles('build/printProductsReleases .txt') }}
196129
197- # Run Verify Plugin task and IntelliJ Plugin Verifier tool
198130 - name : Run Plugin Verification tasks
199- run : ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
131+ run : ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
200132
201- # Collect Plugin Verifier Result
202133 - name : Collect Plugin Verifier Result
203134 if : ${{ always() }}
204- uses : actions/upload-artifact@v6
135+ uses : actions/upload-artifact@v4
205136 with :
206137 name : pluginVerifier-result
207138 path : ${{ github.workspace }}/build/reports/pluginVerifier
208-
209- # Prepare a draft release for GitHub Releases page for the manual verification
210- # If accepted and published, release workflow would be triggered
211- releaseDraft :
212- name : Release draft
213- if : github.event_name != 'pull_request'
214- needs : [ build, test, inspectCode, verify ]
215- runs-on : ubuntu-latest
216- permissions :
217- contents : write
218- steps :
219-
220- # Check out current repository
221- - name : Fetch Sources
222- uses : actions/checkout@v6
223-
224- # Set up Java environment for the next steps
225- - name : Setup Java
226- uses : actions/setup-java@v5
227- with :
228- distribution : zulu
229- java-version : 17
230-
231- # Remove old release drafts by using the curl request for the available releases with a draft flag
232- - name : Remove Old Release Drafts
233- env :
234- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
235- run : |
236- gh api repos/{owner}/{repo}/releases \
237- --jq '.[] | select(.draft == true) | .id' \
238- | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
239-
240- # Create a new release draft which is not publicly visible and requires manual acceptance
241- - name : Create Release Draft
242- env :
243- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
244- run : |
245- gh release create v${{ needs.build.outputs.version }} \
246- --draft \
247- --title "v${{ needs.build.outputs.version }}" \
248- --notes "$(cat << 'EOM'
249- ${{ needs.build.outputs.changelog }}
250- EOM
251- )"
0 commit comments