Skip to content

Commit b671d1d

Browse files
eirikbKylinDC
andauthored
Feature/2021.2 (#24)
* Remove pluginUntilBuild I'm not going to keep updating this for forever. Instead, if the plugin does not work in a newer IntelliJ I'll look into it then. Added verification for 2021.2. Note: Trying to not bump version, since the GitHub Action should do this for me. * Test build: Downgrade ktlint * Force update build Copy/paste from template * Update pluginUntilBuild Field is mandatory for verification. Ugh. Trying * * Update pluginUntilBuild * failed, trying something random but large * Update pluginUntilBuild 9001.* failed, trying something random but large * Update build from template * Test build * Update build java version when run github action * Add latest to plugin verifier ide version * Update pluginVerifierIdeVersions Change from latest to 2021.2, seems "latest" didn't work - at least not in GitHub Actions 🤷 Co-authored-by: KylinDC <[email protected]>
1 parent 99a5d84 commit b671d1d

File tree

4 files changed

+68
-67
lines changed

4 files changed

+68
-67
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
## JBIJPPTPL
1515

1616
name: Build
17-
on: [push, pull_request]
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+
1824
jobs:
1925

2026
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
@@ -25,11 +31,11 @@ jobs:
2531

2632
# Check out current repository
2733
- name: Fetch Sources
28-
uses: actions/checkout@v2
34+
uses: actions/checkout@v2.3.4
2935

3036
# Validate wrapper
3137
- name: Gradle Wrapper Validation
32-
uses: gradle/[email protected].3
38+
uses: gradle/[email protected].4
3339

3440
# Run verifyPlugin and test Gradle tasks
3541
test:
@@ -38,26 +44,27 @@ jobs:
3844
runs-on: ubuntu-latest
3945
steps:
4046

41-
# Setup Java 1.8 environment for the next steps
47+
# Setup Java 11 environment for the next steps
4248
- name: Setup Java
43-
uses: actions/setup-java@v1
49+
uses: actions/setup-java@v2
4450
with:
45-
java-version: 1.8
51+
distribution: zulu
52+
java-version: 11
4653

4754
# Check out current repository
4855
- name: Fetch Sources
49-
uses: actions/checkout@v2
56+
uses: actions/checkout@v2.3.4
5057

5158
# Cache Gradle dependencies
5259
- name: Setup Gradle Dependencies Cache
53-
uses: actions/cache@v2
60+
uses: actions/cache@v2.1.6
5461
with:
5562
path: ~/.gradle/caches
5663
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
5764

5865
# Cache Gradle Wrapper
5966
- name: Setup Gradle Wrapper Cache
60-
uses: actions/cache@v2
67+
uses: actions/cache@v2.1.6
6168
with:
6269
path: ~/.gradle/wrapper
6370
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
@@ -83,26 +90,27 @@ jobs:
8390
artifact: ${{ steps.properties.outputs.artifact }}
8491
steps:
8592

86-
# Setup Java 1.8 environment for the next steps
93+
# Setup Java 11 environment for the next steps
8794
- name: Setup Java
88-
uses: actions/setup-java@v1
95+
uses: actions/setup-java@v2
8996
with:
90-
java-version: 1.8
97+
distribution: zulu
98+
java-version: 11
9199

92100
# Check out current repository
93101
- name: Fetch Sources
94-
uses: actions/checkout@v2
102+
uses: actions/checkout@v2.3.4
95103

96104
# Cache Gradle Dependencies
97105
- name: Setup Gradle Dependencies Cache
98-
uses: actions/cache@v2
106+
uses: actions/cache@v2.1.6
99107
with:
100108
path: ~/.gradle/caches
101109
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
102110

103111
# Cache Gradle Wrapper
104112
- name: Setup Gradle Wrapper Cache
105-
uses: actions/cache@v2
113+
uses: actions/cache@v2.1.6
106114
with:
107115
path: ~/.gradle/wrapper
108116
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
@@ -132,7 +140,7 @@ jobs:
132140

133141
# Upload plugin artifact to make it available in the next jobs
134142
- name: Upload artifact
135-
uses: actions/upload-artifact@v1
143+
uses: actions/upload-artifact@v2.2.3
136144
with:
137145
name: plugin-artifact
138146
path: ./build/distributions/${{ steps.properties.outputs.artifact }}
@@ -145,26 +153,27 @@ jobs:
145153
runs-on: ubuntu-latest
146154
steps:
147155

148-
# Setup Java 1.8 environment for the next steps
156+
# Setup Java 11 environment for the next steps
149157
- name: Setup Java
150-
uses: actions/setup-java@v1
158+
uses: actions/setup-java@v2
151159
with:
152-
java-version: 1.8
160+
distribution: zulu
161+
java-version: 11
153162

154163
# Check out current repository
155164
- name: Fetch Sources
156-
uses: actions/checkout@v2
165+
uses: actions/checkout@v2.3.4
157166

158167
# Cache Gradle Dependencies
159168
- name: Setup Gradle Dependencies Cache
160-
uses: actions/cache@v2
169+
uses: actions/cache@v2.1.6
161170
with:
162171
path: ~/.gradle/caches
163172
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
164173

165174
# Cache Gradle Wrapper
166175
- name: Setup Gradle Wrapper Cache
167-
uses: actions/cache@v2
176+
uses: actions/cache@v2.1.6
168177
with:
169178
path: ~/.gradle/wrapper
170179
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
@@ -182,7 +191,7 @@ jobs:
182191
183192
# Cache Plugin Verifier IDEs
184193
- name: Setup Plugin Verifier IDEs Cache
185-
uses: actions/cache@v2
194+
uses: actions/cache@v2.1.6
186195
with:
187196
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
188197
key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }}
@@ -202,7 +211,7 @@ jobs:
202211

203212
# Check out current repository
204213
- name: Fetch Sources
205-
uses: actions/checkout@v2
214+
uses: actions/checkout@v2.3.4
206215

207216
# Remove old release drafts by using the curl request for the available releases with draft flag
208217
- name: Remove Old Release Drafts
@@ -218,7 +227,7 @@ jobs:
218227
# Create new release draft - which is not publicly visible and requires manual acceptance
219228
- name: Create Release Draft
220229
id: createDraft
221-
uses: actions/create-release@v1
230+
uses: actions/create-release@v1.1.4
222231
env:
223232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224233
with:
@@ -236,7 +245,7 @@ jobs:
236245
# Upload artifact as a release asset
237246
- name: Upload Release Asset
238247
id: upload-release-asset
239-
uses: actions/upload-release-asset@v1
248+
uses: actions/upload-release-asset@v1.0.2
240249
env:
241250
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
242251
with:

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616

17-
# Setup Java 1.8 environment for the next steps
17+
# Setup Java 11 environment for the next steps
1818
- name: Setup Java
1919
uses: actions/setup-java@v1
2020
with:
21-
java-version: 1.8
21+
java-version: 11
2222

2323
# Check out current repository
2424
- name: Fetch Sources
@@ -39,11 +39,11 @@ jobs:
3939
runs-on: ubuntu-latest
4040
steps:
4141

42-
# Setup Java 1.8 environment for the next steps
42+
# Setup Java 11 environment for the next steps
4343
- name: Setup Java
4444
uses: actions/setup-java@v1
4545
with:
46-
java-version: 1.8
46+
java-version: 11
4747

4848
# Check out current repository
4949
- name: Fetch Sources

build.gradle.kts

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import io.gitlab.arturbosch.detekt.Detekt
2-
import org.jetbrains.changelog.closure
32
import org.jetbrains.changelog.markdownToHTML
43
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
54

@@ -9,15 +8,15 @@ plugins {
98
// Java support
109
id("java")
1110
// Kotlin support
12-
id("org.jetbrains.kotlin.jvm") version "1.5.21"
11+
id("org.jetbrains.kotlin.jvm") version "1.5.10"
1312
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
14-
id("org.jetbrains.intellij") version "1.1.4"
13+
id("org.jetbrains.intellij") version "1.0"
1514
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
16-
id("org.jetbrains.changelog") version "1.2.1"
15+
id("org.jetbrains.changelog") version "1.1.2"
1716
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
1817
id("io.gitlab.arturbosch.detekt") version "1.17.1"
1918
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
20-
id("org.jlleitschuh.gradle.ktlint") version "10.1.0"
19+
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
2120
}
2221

2322
group = properties("pluginGroup")
@@ -26,7 +25,6 @@ version = properties("pluginVersion")
2625
// Configure project's dependencies
2726
repositories {
2827
mavenCentral()
29-
jcenter()
3028
}
3129
dependencies {
3230
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1")
@@ -35,14 +33,14 @@ dependencies {
3533
// Configure gradle-intellij-plugin plugin.
3634
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
3735
intellij {
38-
pluginName = properties("pluginName")
39-
version = properties("platformVersion")
40-
type = properties("platformType")
41-
downloadSources = properties("platformDownloadSources").toBoolean()
42-
updateSinceUntilBuild = true
36+
pluginName.set(properties("pluginName"))
37+
version.set(properties("platformVersion"))
38+
type.set(properties("platformType"))
39+
downloadSources.set(properties("platformDownloadSources").toBoolean())
40+
updateSinceUntilBuild.set(true)
4341

4442
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
45-
setPlugins(*properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray())
43+
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
4644
}
4745

4846
// Configure gradle-changelog-plugin plugin.
@@ -80,43 +78,37 @@ tasks {
8078
}
8179

8280
patchPluginXml {
83-
version(properties("pluginVersion"))
84-
sinceBuild(properties("pluginSinceBuild"))
85-
untilBuild(properties("pluginUntilBuild"))
81+
version.set(properties("pluginVersion"))
82+
sinceBuild.set(properties("pluginSinceBuild"))
83+
untilBuild.set(properties("pluginUntilBuild"))
8684

8785
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
88-
pluginDescription(
89-
closure {
90-
File("./README.md").readText().lines().run {
91-
val start = "<!-- Plugin description -->"
92-
val end = "<!-- Plugin description end -->"
93-
94-
if (!containsAll(listOf(start, end))) {
95-
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
96-
}
97-
subList(indexOf(start) + 1, indexOf(end))
98-
}.joinToString("\n").run { markdownToHTML(this) }
99-
}
86+
pluginDescription.set(
87+
File(projectDir, "README.md").readText().lines().run {
88+
val start = "<!-- Plugin description -->"
89+
val end = "<!-- Plugin description end -->"
90+
91+
if (!containsAll(listOf(start, end))) {
92+
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
93+
}
94+
subList(indexOf(start) + 1, indexOf(end))
95+
}.joinToString("\n").run { markdownToHTML(this) }
10096
)
10197

10298
// Get the latest available change notes from the changelog file
103-
changeNotes(
104-
closure {
105-
changelog.getLatest().toHTML()
106-
}
107-
)
99+
changeNotes.set(provider { changelog.getLatest().toHTML() })
108100
}
109101

110102
runPluginVerifier {
111-
ideVersions(properties("pluginVerifierIdeVersions"))
103+
ideVersions.set(properties("pluginVerifierIdeVersions").split(',').map(String::trim).filter(String::isNotEmpty))
112104
}
113105

114106
publishPlugin {
115107
dependsOn("patchChangelog")
116-
token(System.getenv("PUBLISH_TOKEN"))
108+
token.set(System.getenv("PUBLISH_TOKEN"))
117109
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
118110
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
119111
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
120-
channels(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first())
112+
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
121113
}
122114
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ pluginGroup = no.eirikb.avatest
55
pluginName = AvaJavaScriptTestRunnerRunConfigurationGenerator
66
pluginVersion = 1.3.5
77
pluginSinceBuild = 202
8-
pluginUntilBuild = 211.*
8+
pluginUntilBuild = 999.*
99
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
1010
# See https://jb.gg/intellij-platform-builds-list for available build versions
11-
pluginVerifierIdeVersions = 2020.2.4, 2020.3.2, 2021.1
11+
pluginVerifierIdeVersions = 2020.2.4, 2020.3.2, 2021.1, 2021.2
1212

1313
platformType = IU
1414
platformVersion = 2021.1

0 commit comments

Comments
 (0)