Skip to content

Commit 474bfe8

Browse files
committed
Add Themes.
1 parent 7bf62b7 commit 474bfe8

File tree

28 files changed

+2810
-695
lines changed

28 files changed

+2810
-695
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -1,246 +1,51 @@
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-
151
name: Build
2+
163
on:
17-
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g., for dependabot pull requests)
4+
workflow_dispatch:
185
push:
19-
branches: [ main ]
20-
# Trigger the workflow on any pull request
6+
branches:
7+
- main
218
pull_request:
9+
branches:
10+
- main
2211

2312
concurrency:
2413
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2514
cancel-in-progress: true
26-
27-
jobs:
2815

29-
# Prepare the environment and build the plugin
16+
jobs:
3017
build:
31-
name: Build
18+
name: Build Plugin
3219
runs-on: ubuntu-latest
3320
steps:
21+
- name: Checkout Repository
22+
uses: actions/checkout@v5
3423

35-
# Free GitHub Actions Environment Disk Space
36-
- name: Maximize Build Space
37-
uses: jlumbroso/[email protected]
38-
with:
39-
tool-cache: false
40-
large-packages: false
41-
42-
# Check out the current repository
43-
- name: Fetch Sources
44-
uses: actions/checkout@v4
45-
46-
# Set up the Java environment for the next steps
4724
- name: Setup Java
48-
uses: actions/setup-java@v4
25+
uses: actions/setup-java@v5
4926
with:
5027
distribution: zulu
5128
java-version: 21
29+
cache: gradle
5230

53-
# Setup Gradle
5431
- name: Setup Gradle
5532
uses: gradle/actions/setup-gradle@v4
5633

57-
# Build plugin
5834
- name: Build plugin
5935
run: ./gradlew buildPlugin
6036

61-
# Prepare plugin archive content for creating artifact
6237
- name: Prepare Plugin Artifact
6338
id: artifact
6439
shell: bash
6540
run: |
6641
cd ${{ github.workspace }}/build/distributions
6742
FILENAME=`ls *.zip`
6843
unzip "$FILENAME" -d content
69-
44+
7045
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
7146
72-
# Store an already-built plugin as an artifact for downloading
7347
- name: Upload artifact
7448
uses: actions/upload-artifact@v4
7549
with:
7650
name: ${{ steps.artifact.outputs.filename }}
7751
path: ./build/distributions/content/*/*
78-
79-
# Run tests and upload a code coverage report
80-
test:
81-
name: Test
82-
needs: [ build ]
83-
runs-on: ubuntu-latest
84-
steps:
85-
86-
# Free GitHub Actions Environment Disk Space
87-
- name: Maximize Build Space
88-
uses: jlumbroso/[email protected]
89-
with:
90-
tool-cache: false
91-
large-packages: false
92-
93-
# Check out the current repository
94-
- name: Fetch Sources
95-
uses: actions/checkout@v4
96-
97-
# Set up the Java environment for the next steps
98-
- name: Setup Java
99-
uses: actions/setup-java@v4
100-
with:
101-
distribution: zulu
102-
java-version: 21
103-
104-
# Setup Gradle
105-
- name: Setup Gradle
106-
uses: gradle/actions/setup-gradle@v4
107-
with:
108-
cache-read-only: true
109-
110-
# Run tests
111-
- name: Run Tests
112-
run: ./gradlew check
113-
114-
# Collect Tests Result of failed tests
115-
- name: Collect Tests Result
116-
if: ${{ failure() }}
117-
uses: actions/upload-artifact@v4
118-
with:
119-
name: tests-result
120-
path: ${{ github.workspace }}/build/reports/tests
121-
122-
# Upload the Kover report to CodeCov
123-
- name: Upload Code Coverage Report
124-
uses: codecov/codecov-action@v5
125-
with:
126-
files: ${{ github.workspace }}/build/reports/kover/report.xml
127-
token: ${{ secrets.CODECOV_TOKEN }}
128-
129-
# Run Qodana inspections and provide a report
130-
inspectCode:
131-
name: Inspect code
132-
needs: [ build ]
133-
runs-on: ubuntu-latest
134-
permissions:
135-
contents: write
136-
checks: write
137-
pull-requests: write
138-
steps:
139-
140-
# Free GitHub Actions Environment Disk Space
141-
- name: Maximize Build Space
142-
uses: jlumbroso/[email protected]
143-
with:
144-
tool-cache: false
145-
large-packages: false
146-
147-
# Check out the current repository
148-
- name: Fetch Sources
149-
uses: actions/checkout@v4
150-
with:
151-
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
152-
fetch-depth: 0 # a full history is required for pull request analysis
153-
154-
# Set up the Java environment for the next steps
155-
- name: Setup Java
156-
uses: actions/setup-java@v4
157-
with:
158-
distribution: zulu
159-
java-version: 21
160-
161-
# Run Qodana inspections
162-
- name: Qodana - Code Inspection
163-
uses: JetBrains/[email protected]
164-
with:
165-
cache-default-branch-only: true
166-
167-
# Run plugin structure verification along with IntelliJ Plugin Verifier
168-
verify:
169-
name: Verify plugin
170-
needs: [ build ]
171-
runs-on: ubuntu-latest
172-
steps:
173-
174-
# Free GitHub Actions Environment Disk Space
175-
- name: Maximize Build Space
176-
uses: jlumbroso/[email protected]
177-
with:
178-
tool-cache: false
179-
large-packages: false
180-
181-
# Check out the current repository
182-
- name: Fetch Sources
183-
uses: actions/checkout@v4
184-
185-
# Set up the Java environment for the next steps
186-
- name: Setup Java
187-
uses: actions/setup-java@v4
188-
with:
189-
distribution: zulu
190-
java-version: 21
191-
192-
# Setup Gradle
193-
- name: Setup Gradle
194-
uses: gradle/actions/setup-gradle@v4
195-
with:
196-
cache-read-only: true
197-
198-
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
199-
- name: Run Plugin Verification tasks
200-
run: ./gradlew verifyPlugin
201-
202-
# Collect Plugin Verifier Result
203-
- name: Collect Plugin Verifier Result
204-
if: ${{ always() }}
205-
uses: actions/upload-artifact@v4
206-
with:
207-
name: pluginVerifier-result
208-
path: ${{ github.workspace }}/build/reports/pluginVerifier
209-
210-
# Prepare a draft release for GitHub Releases page for the manual verification
211-
# If accepted and published, the release workflow would be triggered
212-
releaseDraft:
213-
name: Release draft
214-
if: github.event_name != 'pull_request'
215-
needs: [ build, test, inspectCode, verify ]
216-
runs-on: ubuntu-latest
217-
permissions:
218-
contents: write
219-
steps:
220-
221-
# Check out the current repository
222-
- name: Fetch Sources
223-
uses: actions/checkout@v4
224-
225-
# Remove old release drafts by using the curl request for the available releases with a draft flag
226-
- name: Remove Old Release Drafts
227-
env:
228-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229-
run: |
230-
gh api repos/{owner}/{repo}/releases \
231-
--jq '.[] | select(.draft == true) | .id' \
232-
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
233-
234-
# Create a new release draft which is not publicly visible and requires manual acceptance
235-
- name: Create Release Draft
236-
env:
237-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
238-
run: |
239-
VERSION=$(./gradlew properties --property version --quiet --console=plain | tail -n 1 | cut -f2- -d ' ')
240-
RELEASE_NOTE="./build/tmp/release_note.txt"
241-
./gradlew getChangelog --unreleased --no-header --quiet --console=plain --output-file=$RELEASE_NOTE
242-
243-
gh release create $VERSION \
244-
--draft \
245-
--title $VERSION \
246-
--notes-file $RELEASE_NOTE

.github/workflows/release.yml

Lines changed: 23 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,50 @@
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 the 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.
1+
name: Publish
42

5-
name: Release
63
on:
7-
release:
8-
types: [prereleased, released]
4+
push:
5+
tags: ["**"]
96

107
jobs:
11-
12-
# Prepare and publish the plugin to JetBrains Marketplace repository
138
release:
149
name: Publish Plugin
1510
runs-on: ubuntu-latest
16-
permissions:
17-
contents: write
18-
pull-requests: write
1911
steps:
20-
21-
# Free GitHub Actions Environment Disk Space
22-
- name: Maximize Build Space
23-
uses: jlumbroso/[email protected]
24-
with:
25-
tool-cache: false
26-
large-packages: false
27-
28-
# Check out the current repository
29-
- name: Fetch Sources
30-
uses: actions/checkout@v4
12+
- name: Checkout Repository
13+
uses: actions/checkout@v5
3114
with:
3215
ref: ${{ github.event.release.tag_name }}
3316

34-
# Set up the Java environment for the next steps
3517
- name: Setup Java
36-
uses: actions/setup-java@v4
18+
uses: actions/setup-java@v5
3719
with:
3820
distribution: zulu
3921
java-version: 21
22+
cache: gradle
4023

41-
# Setup Gradle
4224
- name: Setup Gradle
4325
uses: gradle/actions/setup-gradle@v4
4426
with:
4527
cache-read-only: true
4628

47-
# Update the Unreleased section with the current release note
48-
- name: Patch Changelog
49-
if: ${{ github.event.release.body != '' }}
50-
env:
51-
CHANGELOG: ${{ github.event.release.body }}
29+
- name: Export Properties
5230
run: |
53-
RELEASE_NOTE="./build/tmp/release_note.txt"
54-
mkdir -p "$(dirname "$RELEASE_NOTE")"
55-
echo "$CHANGELOG" > $RELEASE_NOTE
31+
PROPERTIES="$(./gradlew properties --console=plain -q)"
32+
echo "version=$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" >> $GITHUB_ENV
33+
echo "name=$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" >> $GITHUB_ENV
5634
57-
./gradlew patchChangelog --release-note-file=$RELEASE_NOTE
35+
- name: Patch Changelog
36+
run: ./gradlew patchChangelog
5837

59-
# Publish the plugin to JetBrains Marketplace
60-
- name: Publish Plugin
61-
env:
62-
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
63-
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
64-
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
65-
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
66-
run: ./gradlew publishPlugin
38+
- name: Build Plugin
39+
run: ./gradlew buildPlugin
6740

68-
# Upload an artifact as a release asset
69-
- name: Upload Release Asset
70-
env:
71-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
41+
- name: Upload JAR
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: ${{ env.name }}-${{ env.version }}.jar
45+
path: build/libs/*.jar
7346

74-
# Create a pull request
75-
- name: Create Pull Request
76-
if: ${{ steps.properties.outputs.changelog != '' }}
47+
- name: Publish Plugin
7748
env:
78-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79-
run: |
80-
VERSION="${{ github.event.release.tag_name }}"
81-
BRANCH="changelog-update-$VERSION"
82-
LABEL="release changelog"
83-
84-
git config user.email "[email protected]"
85-
git config user.name "GitHub Action"
86-
87-
git checkout -b $BRANCH
88-
git commit -am "Changelog update - $VERSION"
89-
git push --set-upstream origin $BRANCH
90-
91-
gh label create "$LABEL" \
92-
--description "Pull requests with release changelog update" \
93-
--force \
94-
|| true
95-
96-
gh pr create \
97-
--title "Changelog update - \`$VERSION\`" \
98-
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
99-
--label "$LABEL" \
100-
--head $BRANCH
49+
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }}
50+
run: ./gradlew publishPlugin

0 commit comments

Comments
 (0)