Skip to content

Commit 0bf8c5d

Browse files
authored
Merge pull request #1124 from Aalto-LeTech/4.0.1
4.0.1-4.0.3
2 parents a1e2a0e + e04917f commit 0bf8c5d

29 files changed

+484
-159
lines changed

.github/workflows/build.yml

Lines changed: 263 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,263 @@
1+
# https://github.com/JetBrains/intellij-platform-plugin-template/blob/main/.github/workflows/build.yml
2+
# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
3+
# - Validate Gradle Wrapper.
4+
# - Run 'test' and 'verifyPlugin' tasks.
5+
# - Run Qodana inspections.
6+
# - Run the 'buildPlugin' task and prepare artifact for further tests.
7+
# - Run the 'runPluginVerifier' task.
8+
# - Create a draft release.
9+
#
10+
# The workflow is triggered on push and pull_request events.
11+
#
12+
# GitHub Actions reference: https://help.github.com/en/actions
13+
#
14+
## JBIJPPTPL
15+
16+
name: Build
17+
on:
18+
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
19+
push:
20+
branches: [ main ]
21+
# Trigger the workflow on any pull request
22+
pull_request:
23+
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
26+
cancel-in-progress: true
27+
28+
jobs:
29+
30+
# Prepare environment and build the plugin
31+
build:
32+
name: Build
33+
runs-on: ubuntu-latest
34+
outputs:
35+
version: ${{ steps.properties.outputs.version }}
36+
changelog: ${{ steps.properties.outputs.changelog }}
37+
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
38+
steps:
39+
40+
# Check out the current repository
41+
- name: Fetch Sources
42+
uses: actions/checkout@v4
43+
44+
# Validate wrapper
45+
- name: Gradle Wrapper Validation
46+
uses: gradle/actions/wrapper-validation@v3
47+
48+
# Set up Java environment for the next steps
49+
- name: Setup Java
50+
uses: actions/setup-java@v4
51+
with:
52+
distribution: zulu
53+
java-version: 21
54+
55+
# Setup Gradle
56+
- name: Setup Gradle
57+
uses: gradle/actions/setup-gradle@v3
58+
with:
59+
gradle-home-cache-cleanup: true
60+
61+
# Set environment variables
62+
- name: Export Properties
63+
id: properties
64+
shell: bash
65+
run: |
66+
PROPERTIES="$(./gradlew properties --console=plain -q)"
67+
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
68+
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
69+
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
76+
77+
# Build plugin
78+
- name: Build plugin
79+
run: ./gradlew buildPlugin
80+
81+
# Prepare plugin archive content for creating artifact
82+
- name: Prepare Plugin Artifact
83+
id: artifact
84+
shell: bash
85+
run: |
86+
cd ${{ github.workspace }}/build/distributions
87+
FILENAME=`ls *.zip`
88+
unzip "$FILENAME" -d content
89+
90+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
91+
92+
# Store already-built plugin as an artifact for downloading
93+
- name: Upload artifact
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: ${{ steps.artifact.outputs.filename }}
97+
path: ./build/distributions/content/*/*
98+
99+
# Run tests and upload a code coverage report
100+
test:
101+
name: Test
102+
needs: [ build ]
103+
runs-on: ubuntu-latest
104+
steps:
105+
106+
# Check out the current repository
107+
- name: Fetch Sources
108+
uses: actions/checkout@v4
109+
110+
# Set up Java environment for the next steps
111+
- name: Setup Java
112+
uses: actions/setup-java@v4
113+
with:
114+
distribution: zulu
115+
java-version: 21
116+
117+
# Setup Gradle
118+
- name: Setup Gradle
119+
uses: gradle/actions/setup-gradle@v3
120+
with:
121+
gradle-home-cache-cleanup: true
122+
123+
# Run tests
124+
- name: Run Tests
125+
run: ./gradlew check
126+
127+
# Collect Tests Result of failed tests
128+
- name: Collect Tests Result
129+
if: ${{ failure() }}
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: tests-result
133+
path: ${{ github.workspace }}/build/reports/tests
134+
135+
# Upload the Kover report to CodeCov
136+
- name: Upload Code Coverage Report
137+
uses: codecov/codecov-action@v4
138+
with:
139+
files: ${{ github.workspace }}/build/reports/kover/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+
# Free GitHub Actions Environment Disk Space
153+
- name: Maximize Build Space
154+
uses: jlumbroso/free-disk-space@main
155+
with:
156+
tool-cache: false
157+
large-packages: false
158+
159+
# Check out the current repository
160+
- name: Fetch Sources
161+
uses: actions/checkout@v4
162+
163+
# Set up Java environment for the next steps
164+
- name: Setup Java
165+
uses: actions/setup-java@v4
166+
with:
167+
distribution: zulu
168+
java-version: 21
169+
170+
# Run Qodana inspections
171+
- name: Qodana - Code Inspection
172+
uses: JetBrains/[email protected]
173+
with:
174+
cache-default-branch-only: true
175+
env:
176+
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
177+
178+
# Run plugin structure verification along with IntelliJ Plugin Verifier
179+
verify:
180+
name: Verify plugin
181+
needs: [ build ]
182+
runs-on: ubuntu-latest
183+
steps:
184+
185+
# Free GitHub Actions Environment Disk Space
186+
- name: Maximize Build Space
187+
uses: jlumbroso/free-disk-space@main
188+
with:
189+
tool-cache: false
190+
large-packages: false
191+
192+
# Check out the current repository
193+
- name: Fetch Sources
194+
uses: actions/checkout@v4
195+
196+
# Set up Java environment for the next steps
197+
- name: Setup Java
198+
uses: actions/setup-java@v4
199+
with:
200+
distribution: zulu
201+
java-version: 21
202+
203+
# Setup Gradle
204+
- name: Setup Gradle
205+
uses: gradle/actions/setup-gradle@v3
206+
with:
207+
gradle-home-cache-cleanup: true
208+
209+
# Cache Plugin Verifier IDEs
210+
- name: Setup Plugin Verifier IDEs Cache
211+
uses: actions/cache@v4
212+
with:
213+
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
214+
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
215+
216+
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
217+
- name: Run Plugin Verification tasks
218+
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
219+
220+
# Collect Plugin Verifier Result
221+
- name: Collect Plugin Verifier Result
222+
if: ${{ always() }}
223+
uses: actions/upload-artifact@v4
224+
with:
225+
name: pluginVerifier-result
226+
path: ${{ github.workspace }}/build/reports/pluginVerifier
227+
228+
# Prepare a draft release for GitHub Releases page for the manual verification
229+
# If accepted and published, release workflow would be triggered
230+
releaseDraft:
231+
name: Release draft
232+
if: github.event_name != 'pull_request'
233+
needs: [ build, test, inspectCode, verify ]
234+
runs-on: ubuntu-latest
235+
permissions:
236+
contents: write
237+
steps:
238+
239+
# Check out the current repository
240+
- name: Fetch Sources
241+
uses: actions/checkout@v4
242+
243+
# Remove old release drafts by using the curl request for the available releases with a draft flag
244+
- name: Remove Old Release Drafts
245+
env:
246+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
247+
run: |
248+
gh api repos/{owner}/{repo}/releases \
249+
--jq '.[] | select(.draft == true) | .id' \
250+
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
251+
252+
# Create a new release draft which is not publicly visible and requires manual acceptance
253+
- name: Create Release Draft
254+
env:
255+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
256+
run: |
257+
gh release create "v${{ needs.build.outputs.version }}" \
258+
--draft \
259+
--title "v${{ needs.build.outputs.version }}" \
260+
--notes "$(cat << 'EOM'
261+
${{ needs.build.outputs.changelog }}
262+
EOM
263+
)"

.github/workflows/pullrequest.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/push.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
## [Unreleased]
1+
<!-- Keep a Changelog guide -> https://keepachangelog.com -->
2+
3+
# A+ Courses Changelog
4+
5+
## [4.0.3] - 2024-09-04
6+
7+
### Fixed
8+
9+
- Increased network timeout to prevent module downloads from stopping on slower connections
10+
11+
## [4.0.0] - 2024-08-23
12+
13+
### Changed
14+
15+
- Complete UI overhaul
16+
- Rewrite of the plugin from Java to Kotlin
17+
18+
## [Unreleased]

0 commit comments

Comments
 (0)