Skip to content

Commit c5f2e6a

Browse files
authored
Merge pull request #15 from AleksandrSl/dev
chore: update setup
2 parents 107777e + 6b10b69 commit c5f2e6a

File tree

7 files changed

+112
-42
lines changed

7 files changed

+112
-42
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33

44
version: 2
55
updates:
6+
# Maintain dependencies for Gradle dependencies
67
- package-ecosystem: "gradle"
78
directory: "/"
9+
target-branch: "next"
810
schedule:
911
interval: "daily"
12+
# Maintain dependencies for GitHub Actions
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
target-branch: "next"
16+
schedule:
17+
interval: "daily"

.github/workflows/build.yml

Lines changed: 42 additions & 22 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,
@@ -33,21 +33,27 @@ jobs:
3333
changelog: ${{ steps.properties.outputs.changelog }}
3434
steps:
3535

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

4047
# Validate wrapper
4148
- name: Gradle Wrapper Validation
42-
uses: gradle/wrapper-validation-action@v1.0.4
49+
uses: gradle/wrapper-validation-action@v1.0.5
4350

4451
# Setup Java 11 environment for the next steps
4552
- name: Setup Java
46-
uses: actions/setup-java@v2
53+
uses: actions/setup-java@v3
4754
with:
4855
distribution: zulu
4956
java-version: 11
50-
cache: gradle
5157

5258
# Set environment variables
5359
- name: Export Properties
@@ -58,29 +64,38 @@ jobs:
5864
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
5965
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
6066
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
61-
CHANGELOG="${CHANGELOG//'%'/'%25'}"
62-
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
63-
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
64-
echo "::set-output name=version::$VERSION"
65-
echo "::set-output name=name::$NAME"
66-
echo "::set-output name=changelog::$CHANGELOG"
67-
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
67+
68+
echo "version=$VERSION" >> $GITHUB_OUTPUT
69+
echo "name=$NAME" >> $GITHUB_OUTPUT
70+
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
71+
72+
echo "changelog<<EOF" >> $GITHUB_OUTPUT
73+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
74+
echo "EOF" >> $GITHUB_OUTPUT
75+
6876
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
77+
6978
# Run tests
7079
- name: Run Tests
71-
run: ./gradlew test
80+
run: ./gradlew check
7281

7382
# Collect Tests Result of failed tests
7483
- name: Collect Tests Result
7584
if: ${{ failure() }}
76-
uses: actions/upload-artifact@v2
85+
uses: actions/upload-artifact@v3
7786
with:
7887
name: tests-result
7988
path: ${{ github.workspace }}/build/reports/tests
8089

90+
# Upload Kover report to CodeCov
91+
- name: Upload Code Coverage Report
92+
uses: codecov/codecov-action@v3
93+
with:
94+
files: ${{ github.workspace }}/build/reports/kover/xml/report.xml
95+
8196
# Cache Plugin Verifier IDEs
8297
- name: Setup Plugin Verifier IDEs Cache
83-
uses: actions/cache@v2.1.7
98+
uses: actions/cache@v3
8499
with:
85100
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
86101
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
@@ -92,14 +107,14 @@ jobs:
92107
# Collect Plugin Verifier Result
93108
- name: Collect Plugin Verifier Result
94109
if: ${{ always() }}
95-
uses: actions/upload-artifact@v2
110+
uses: actions/upload-artifact@v3
96111
with:
97112
name: pluginVerifier-result
98113
path: ${{ github.workspace }}/build/reports/pluginVerifier
99114

100115
# Run Qodana inspections
101116
- name: Qodana - Code Inspection
102-
uses: JetBrains/qodana-action@v4.2.5
117+
uses: JetBrains/qodana-action@v2022.3.0
103118

104119
# Prepare plugin archive content for creating artifact
105120
- name: Prepare Plugin Artifact
@@ -109,10 +124,12 @@ jobs:
109124
cd ${{ github.workspace }}/build/distributions
110125
FILENAME=`ls *.zip`
111126
unzip "$FILENAME" -d content
112-
echo "::set-output name=filename::${FILENAME:0:-4}"
127+
128+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
129+
113130
# Store already-built plugin as an artifact for downloading
114131
- name: Upload artifact
115-
uses: actions/upload-artifact@v2.2.4
132+
uses: actions/upload-artifact@v3
116133
with:
117134
name: ${{ steps.artifact.outputs.filename }}
118135
path: ./build/distributions/content/*/*
@@ -124,21 +141,24 @@ jobs:
124141
if: github.event_name != 'pull_request'
125142
needs: build
126143
runs-on: ubuntu-latest
144+
permissions:
145+
contents: write
127146
steps:
128147

129148
# Check out current repository
130149
- name: Fetch Sources
131-
uses: actions/checkout@v2.4.0
150+
uses: actions/checkout@v3
132151

133-
# Remove old release drafts by using the curl request for the available releases with draft flag
152+
# Remove old release drafts by using the curl request for the available releases with a draft flag
134153
- name: Remove Old Release Drafts
135154
env:
136155
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137156
run: |
138157
gh api repos/{owner}/{repo}/releases \
139158
--jq '.[] | select(.draft == true) | .id' \
140159
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
141-
# Create new release draft - which is not publicly visible and requires manual acceptance
160+
161+
# Create a new release draft which is not publicly visible and requires manual acceptance
142162
- name: Create Release Draft
143163
env:
144164
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 24 additions & 7 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,23 @@ 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

2327
# Setup Java 11 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
2832
java-version: 11
29-
cache: gradle
3033

3134
# Set environment variables
3235
- name: Export Properties
@@ -41,18 +44,24 @@ jobs:
4144
CHANGELOG="${CHANGELOG//'%'/'%25'}"
4245
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
4346
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
44-
echo "::set-output name=changelog::$CHANGELOG"
47+
48+
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
49+
4550
# Update Unreleased section with the current release note
4651
- name: Patch Changelog
4752
if: ${{ steps.properties.outputs.changelog != '' }}
4853
env:
4954
CHANGELOG: ${{ steps.properties.outputs.changelog }}
5055
run: |
5156
./gradlew patchChangelog --release-note="$CHANGELOG"
57+
5258
# Publish the plugin to the Marketplace
5359
- name: Publish Plugin
5460
env:
5561
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
62+
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
63+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
64+
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
5665
run: ./gradlew publishPlugin
5766

5867
# Upload artifact as a release asset
@@ -69,13 +78,21 @@ jobs:
6978
run: |
7079
VERSION="${{ github.event.release.tag_name }}"
7180
BRANCH="changelog-update-$VERSION"
81+
LABEL="release changelog"
82+
7283
git config user.email "action@github.com"
7384
git config user.name "GitHub Action"
85+
7486
git checkout -b $BRANCH
7587
git commit -am "Changelog update - $VERSION"
7688
git push --set-upstream origin $BRANCH
89+
90+
gh label create "$LABEL" \
91+
--description "Pull requests with release changelog update" \
92+
|| true
93+
7794
gh pr create \
7895
--title "Changelog update - \`$VERSION\`" \
7996
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
80-
--base main \
97+
--label "$LABEL" \
8198
--head $BRANCH

.run/Run Plugin Tests.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</option>
1212
<option name="taskNames">
1313
<list>
14-
<option value="test" />
14+
<option value="check" />
1515
</list>
1616
</option>
1717
<option name="vmOptions" value="" />

build.gradle.kts

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.changelog.Changelog
12
import org.jetbrains.changelog.markdownToHTML
23
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
34

@@ -7,13 +8,15 @@ plugins {
78
// Java support
89
id("java")
910
// Kotlin support
10-
id("org.jetbrains.kotlin.jvm") version "1.6.10"
11+
id("org.jetbrains.kotlin.jvm") version "1.8.0"
1112
// Gradle IntelliJ Plugin
12-
id("org.jetbrains.intellij") version "1.6.0"
13+
id("org.jetbrains.intellij") version "1.12.0"
1314
// Gradle Changelog Plugin
14-
id("org.jetbrains.changelog") version "1.3.1"
15+
id("org.jetbrains.changelog") version "2.0.0"
1516
// Gradle Qodana Plugin
1617
id("org.jetbrains.qodana") version "0.1.13"
18+
// Gradle Kover Plugin
19+
id("org.jetbrains.kotlinx.kover") version "0.6.1"
1720

1821
id("org.jetbrains.grammarkit") version "2021.2.2"
1922
}
@@ -26,6 +29,11 @@ repositories {
2629
mavenCentral()
2730
}
2831

32+
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
33+
kotlin {
34+
jvmToolchain(11)
35+
}
36+
2937
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
3038
intellij {
3139
pluginName.set(properties("pluginName"))
@@ -38,8 +46,8 @@ intellij {
3846

3947
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
4048
changelog {
41-
version.set(properties("pluginVersion"))
4249
groups.set(emptyList())
50+
repositoryUrl.set(properties("pluginRepositoryUrl"))
4351
}
4452

4553
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
@@ -50,6 +58,11 @@ qodana {
5058
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
5159
}
5260

61+
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
62+
kover.xmlReport {
63+
onCheck.set(true)
64+
}
65+
5366
grammarKit {
5467
jflexRelease.set("1.7.0-1")
5568
grammarKitRelease.set("2021.1.2")
@@ -104,7 +117,7 @@ tasks {
104117
patchPluginXml {
105118
version.set(properties("pluginVersion"))
106119
sinceBuild.set(properties("pluginSinceBuild"))
107-
// untilBuild.set(properties("pluginUntilBuild"))
120+
untilBuild.set("")
108121

109122
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
110123
pluginDescription.set(
@@ -121,9 +134,13 @@ tasks {
121134

122135
// Get the latest available change notes from the changelog file
123136
changeNotes.set(provider {
124-
changelog.run {
125-
getOrNull(properties("pluginVersion")) ?: getLatest()
126-
}.toHTML()
137+
with(changelog) {
138+
renderItem(
139+
getOrNull(properties("pluginVersion"))
140+
?: runCatching { getLatest() }.getOrElse { getUnreleased() },
141+
Changelog.OutputType.HTML,
142+
)
143+
}
127144
})
128145
}
129146

gradle.properties

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
pluginGroup = com.github.aleksandrsl.intellijbrowserslist
55
pluginName = intellij-browserslist
6+
pluginRepositoryUrl = https://github.com/AleksandrSl/intellij-browserslist
67
# SemVer format -> https://semver.org
78
pluginVersion = 1.0.2
89
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
@@ -26,9 +27,12 @@ platformPlugins = JavaScriptLanguage
2627
javaVersion = 11
2728

2829
# Gradle Releases -> https://github.com/gradle/gradle/releases
29-
gradleVersion = 7.4
30+
gradleVersion = 7.6
3031

31-
# Opt-out flag for bundling Kotlin standard library.
32-
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
32+
# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
3333
# suppress inspection "UnusedProperty"
3434
kotlin.stdlib.default.dependency = false
35+
36+
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
37+
# suppress inspection "UnusedProperty"
38+
org.gradle.unsafe.configuration-cache = true

qodana.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33

44
version: 1.0
55
profile:
6-
name: qodana.recommended
6+
name: qodana.recommended
7+
exclude:
8+
- name: All
9+
paths:
10+
- .qodana

0 commit comments

Comments
 (0)