Skip to content

Commit 712dffb

Browse files
committed
Update configs and workflows
1 parent 654dd0a commit 712dffb

5 files changed

Lines changed: 41 additions & 37 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,26 @@ jobs:
1919
changelog: ${{ steps.properties.outputs.changelog }}
2020
steps:
2121

22+
# Free GitHub Actions Environment Disk Space
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
2228
# Check out current repository
2329
- name: Fetch Sources
24-
uses: actions/checkout@v2.4.0
30+
uses: actions/checkout@v3
2531

2632
# Validate wrapper
2733
- name: Gradle Wrapper Validation
2834
uses: gradle/[email protected]
2935

3036
# Setup Java 11 environment for the next steps
3137
- name: Setup Java
32-
uses: actions/setup-java@v2
38+
uses: actions/setup-java@v3
3339
with:
3440
distribution: zulu
3541
java-version: 11
36-
cache: gradle
3742

3843
# Set environment variables
3944
- name: Export Properties
@@ -55,19 +60,19 @@ jobs:
5560
5661
# Cache Plugin Verifier IDEs
5762
- name: Setup Plugin Verifier IDEs Cache
58-
uses: actions/cache@v2.1.7
63+
uses: actions/cache@v3
5964
with:
6065
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
6166
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
6267

6368
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
6469
- name: Run Plugin Verification tasks
65-
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
70+
run: ./gradlew runPluginVerifier -Plugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
6671

6772
# Collect Plugin Verifier Result
6873
- name: Collect Plugin Verifier Result
6974
if: ${{ always() }}
70-
uses: actions/upload-artifact@v2
75+
uses: actions/upload-artifact@v3
7176
with:
7277
name: pluginVerifier-result
7378
path: ${{ github.workspace }}/build/reports/pluginVerifier
@@ -83,7 +88,7 @@ jobs:
8388
echo "::set-output name=filename::${FILENAME:0:-4}"
8489
# Store already-built plugin as an artifact for downloading
8590
- name: Upload artifact
86-
uses: actions/upload-artifact@v2.2.4
91+
uses: actions/upload-artifact@v3
8792
with:
8893
name: ${{ steps.artifact.outputs.filename }}
8994
path: ./build/distributions/content/*/*
@@ -95,11 +100,13 @@ jobs:
95100
if: github.event_name != 'pull_request'
96101
needs: build
97102
runs-on: ubuntu-latest
103+
permissions:
104+
contents: write
98105
steps:
99106

100107
# Check out current repository
101108
- name: Fetch Sources
102-
uses: actions/checkout@v2.4.0
109+
uses: actions/checkout@v3
103110

104111
# Remove old release drafts by using the curl request for the available releases with draft flag
105112
- name: Remove Old Release Drafts

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,23 @@ jobs:
99
release:
1010
name: Publish Plugin
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
1215
steps:
1316

1417
# Check out current repository
1518
- name: Fetch Sources
16-
uses: actions/checkout@v2.4.0
19+
uses: actions/checkout@v3
1720
with:
1821
ref: ${{ github.event.release.tag_name }}
1922

2023
# Setup Java 11 environment for the next steps
2124
- name: Setup Java
22-
uses: actions/setup-java@v2
25+
uses: actions/setup-java@v3
2326
with:
2427
distribution: zulu
2528
java-version: 11
26-
cache: gradle
2729

2830
# Set environment variables
2931
- name: Export Properties

build.gradle.kts

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import org.jetbrains.changelog.date
22
import org.jetbrains.changelog.markdownToHTML
3-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
43

54
fun properties(key: String) = project.findProperty(key).toString()
65

@@ -17,6 +16,12 @@ repositories {
1716
mavenCentral()
1817
}
1918

19+
kotlin {
20+
jvmToolchain {
21+
this.languageVersion.set(JavaLanguageVersion.of(properties("javaVersion")))
22+
}
23+
}
24+
2025
intellij {
2126
pluginName.set(properties("pluginName"))
2227
version.set(properties("platformVersion"))
@@ -32,17 +37,6 @@ changelog {
3237
}
3338

3439
tasks {
35-
// Set the JVM compatibility versions
36-
properties("javaVersion").let {
37-
withType<JavaCompile> {
38-
sourceCompatibility = it
39-
targetCompatibility = it
40-
}
41-
withType<KotlinCompile> {
42-
kotlinOptions.jvmTarget = it
43-
}
44-
}
45-
4640
wrapper {
4741
gradleVersion = properties("gradleVersion")
4842
}
@@ -58,17 +52,15 @@ tasks {
5852
}.toHTML()
5953
})
6054

61-
pluginDescription.set(
62-
projectDir.resolve("README.md").readText().lines().run {
63-
val start = "<!-- Plugin description -->"
64-
val end = "<!-- Plugin description end -->"
55+
pluginDescription.set(file("README.md").readText().lines().run {
56+
val start = "<!-- Plugin description -->"
57+
val end = "<!-- Plugin description end -->"
6558

66-
if (!containsAll(listOf(start, end))) {
67-
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
68-
}
69-
subList(indexOf(start) + 1, indexOf(end))
70-
}.joinToString("\n").run { markdownToHTML(this) }
71-
)
59+
if (!containsAll(listOf(start, end))) {
60+
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
61+
}
62+
subList(indexOf(start) + 1, indexOf(end))
63+
}.joinToString("\n").run { markdownToHTML(this) })
7264
}
7365

7466
signPlugin {

gradle.properties

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pluginVersion = 0.3.0
77
pluginSinceBuild = 213
88
pluginUntilBuild = 223.*
99

10-
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
10+
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
1111
platformType = PC
1212
platformVersion = 2022.1
1313

@@ -19,9 +19,12 @@ platformPlugins = PythonCore
1919
javaVersion = 11
2020

2121
# Gradle Releases -> https://github.com/gradle/gradle/releases
22-
gradleVersion = 7.5
22+
gradleVersion = 7.5.1
2323

2424
# Opt-out flag for bundling Kotlin standard library.
2525
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
2626
# suppress inspection "UnusedProperty"
27-
kotlin.stdlib.default.dependency = false
27+
kotlin.stdlib.default.dependency = false
28+
29+
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
30+
org.gradle.unsafe.configuration-cache = true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)