Skip to content

Commit b8d5ff6

Browse files
authored
Fix release workflow and polish codecov
1 parent 8a7f5a4 commit b8d5ff6

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed
File renamed without changes.

.github/workflows/README.adoc

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,41 +56,45 @@ $ ./gradlew preprocessWorkflows
5656

5757
There are currently three known caveats with the approach we follow.
5858

59-
* https://youtrack.jetbrains.com/issue/KTIJ-16532
60-
+
59+
=== https://youtrack.jetbrains.com/issue/KTIJ-16532
60+
6161
If you navigate to a file in the dependencies, only a decompiled file is opened,
6262
even though the source JAR would be available. Also the quick documentation is missing.
63-
+
63+
6464
This can easily by mitigated by attaching the library to the normal project
6565
dependencies while having the need to navigate the source files or while editing them,
6666
which makes them properly viewable and documentation displayable in the editor.
6767

68-
* https://youtrack.jetbrains.com/issue/KTIJ-14580
69-
+
68+
=== https://youtrack.jetbrains.com/issue/KTIJ-14580
69+
7070
We use `@file:Import` to reduce code duplication by having common code in a common file.
7171
Unfortunately, this triggers a Kotlin IntelliJ plugin bug where the imported file cannot
7272
be loaded properly and so the things supplied by it like dependencies or common functions
7373
are not available. This makes most of the workflow `*.main.kts` files red as hell in the
7474
IDE currently.
75-
+
75+
7676
To reduce risk for eye-cancer while reading the `*.main.kts` scripts or to be able to
7777
sanely edit them, temporarily add the `@file:DependsOn` from the imported file to the
7878
importing file and wait a second, then remove the line again once you are done.
7979

80-
* https://youtrack.jetbrains.com/issue/KT-42101
81-
+
80+
=== https://youtrack.jetbrains.com/issue/KT-42101
81+
8282
We use `@file:Import` to reduce code duplication by having common code in a common file.
8383
Unfortunately, this triggers a Kotlin bug where the compilation cache becomes confused
8484
if the imported file is changed without the importing file being changed too.
85-
+
85+
8686
If only the imported file is changed, it could happen that an old version is used,
8787
or it could also happen that classes added by a `@file:DependsOn` in the imported file
8888
are not available to the importing file. So if there was a change in the imported file,
8989
you either need to also change the importing file, or to properly execute the script,
90-
you need to delete the stale entry from the compilation cache which can be found at for example
91-
`~/.cache/main.kts.compiled.cache/` on Linux and `%LOCALAPPDATA%\main.kts.compiled.cache\`
92-
on Windows. Alternatively, you can also delete the whole cache directory.
93-
+
90+
you need to delete the stale entry from the compilation cache which can be found here:
91+
92+
- On Windows the default location is at `%LOCALAPPDATA%\main.kts.compiled.cache\`.
93+
- On Linux the default location is at `$XDG_CACHE_HOME/main.kts.compiled.cache/` or `~/.cache/main.kts.compiled.cache/`.
94+
- On macOS the default location is at `~/Library/Caches/main.kts.compiled.cache/`.
95+
96+
Alternatively, you can also delete the whole cache directory.
97+
9498
Another option is to disable the compilation cache for the execution by setting the
9599
environment variable `KOTLIN_MAIN_KTS_COMPILED_SCRIPTS_CACHE_DIR` or the system property
96100
`kotlin.main.kts.compiled.scripts.cache.dir` to an empty value, depending on the run

.github/workflows/branches-and-prs.main.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ workflow(
7676
}
7777

7878
val matrix = Matrix.full
79-
with(__FILE__.parentFile.resolve("../../codecov.yml")) {
79+
with(__FILE__.parentFile.resolve("../codecov.yml")) {
8080
readText()
8181
.replace("after_n_builds:.*+$".toRegex(), "after_n_builds: ${matrix.size}")
8282
.let(::writeText)

.github/workflows/release.main.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ workflow(
4747
val SIGNING_GPG_PASSWORD by secrets
4848

4949
val matrix = Matrix.full
50-
with(__FILE__.parentFile.resolve("../../codecov.yml")) {
50+
with(__FILE__.parentFile.resolve("../codecov.yml")) {
5151
readText()
5252
.replace("after_n_builds:.*+$".toRegex(), "after_n_builds: ${matrix.size}")
5353
.let(::writeText)
@@ -82,7 +82,7 @@ workflow(
8282
"ghActionsBuild",
8383
""""-Dvariant=${expr(Matrix.variant)}"""",
8484
""""-DjavaVersion=${expr(Matrix.javaVersion)}"""",
85-
"-Dscan.tag.main-build"
85+
""""-Dscan.tag.main-build""""
8686
).joinToString(" "),
8787
env = commonCredentials
8888
)
@@ -129,7 +129,7 @@ workflow(
129129
"ghActionsPublish",
130130
""""-Dvariant=${expr(Matrix.variant)}"""",
131131
""""-DjavaVersion=${expr(Matrix.javaVersion)}"""",
132-
"-Dscan.tag.main-publish"
132+
""""-Dscan.tag.main-publish""""
133133
).joinToString(" "),
134134
env = mutableMapOf(
135135
"GITHUB_TOKEN" to expr(GITHUB_TOKEN),
@@ -179,7 +179,7 @@ workflow(
179179
"ghActionsDocs",
180180
""""-Dvariant=${expr(Matrix.variant)}"""",
181181
""""-DjavaVersion=${expr(Matrix.javaVersion)}"""",
182-
"-Dscan.tag.main-docs"
182+
""""-Dscan.tag.main-docs""""
183183
).joinToString(" "),
184184
env = mutableMapOf(
185185
"GITHUB_TOKEN" to expr(GITHUB_TOKEN)

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
name: 'Build Spock'
8989
env:
9090
DEVELOCITY_ACCESS_KEY: '${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}'
91-
run: './gradlew --stacktrace ghActionsBuild "-Dvariant=${{ matrix.variant }}" "-DjavaVersion=${{ matrix.java }}" -Dscan.tag.main-build'
91+
run: './gradlew --stacktrace ghActionsBuild "-Dvariant=${{ matrix.variant }}" "-DjavaVersion=${{ matrix.java }}" "-Dscan.tag.main-build"'
9292
- id: 'step-3'
9393
name: 'Stop Daemon'
9494
run: './gradlew --stop'
@@ -130,7 +130,7 @@ jobs:
130130
SONATYPE_OSS_PASSWORD: '${{ secrets.SONATYPE_OSS_PASSWORD }}'
131131
SIGNING_PASSWORD: '${{ secrets.SIGNING_GPG_PASSWORD }}'
132132
DEVELOCITY_ACCESS_KEY: '${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}'
133-
run: './gradlew --no-parallel --stacktrace ghActionsPublish "-Dvariant=${{ matrix.variant }}" "-DjavaVersion=${{ matrix.java }}" -Dscan.tag.main-publish'
133+
run: './gradlew --no-parallel --stacktrace ghActionsPublish "-Dvariant=${{ matrix.variant }}" "-DjavaVersion=${{ matrix.java }}" "-Dscan.tag.main-publish"'
134134
publish-release-docs:
135135
name: 'Publish Release Docs'
136136
runs-on: '${{ matrix.os }}'
@@ -165,4 +165,4 @@ jobs:
165165
env:
166166
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
167167
DEVELOCITY_ACCESS_KEY: '${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}'
168-
run: './gradlew --no-parallel --stacktrace ghActionsDocs "-Dvariant=${{ matrix.variant }}" "-DjavaVersion=${{ matrix.java }}" -Dscan.tag.main-docs'
168+
run: './gradlew --no-parallel --stacktrace ghActionsDocs "-Dvariant=${{ matrix.variant }}" "-DjavaVersion=${{ matrix.java }}" "-Dscan.tag.main-docs"'

0 commit comments

Comments
 (0)