Skip to content

Commit aeeea11

Browse files
authored
fix(docs): use lib's version for docs directly (#1551)
Closes #1550. There's a problem with a breaking change in setuptools, which causes issues when installing `mkdocs-markdownextradata-plugin`. This plugin hasn't been touched for 3 years, so I doubt anyone will fix it. That's why we're removing usage of it, it's pretty cheap. We're going to stop using the lib's version in the docs as soon as we stop bundling the action bindings, which is approx. in a month.
1 parent 00a65ee commit aeeea11

File tree

5 files changed

+90
-96
lines changed

5 files changed

+90
-96
lines changed

automation/code-generator/src/main/kotlin/io/github/typesafegithub/workflows/codegenerator/ActionsDocsGeneration.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ internal fun deleteListOfBindingsInDocs() {
6969

7070
private val listOfBindingsInDocs = Paths.get("docs/supported-actions.md")
7171

72+
private const val LIB_VERSION = "2.2.1-SNAPSHOT"
73+
7274
private fun Pair<ActionBindingRequest, ActionBinding>.toMarkdownLinkToKotlinCode(
7375
packageName: String,
7476
className: String,
7577
): String {
7678
val typingsMarker = if (this.second.typingActualSource == TypingActualSource.ACTION) "" else ""
7779
return "${this.first.actionCoords.version}$typingsMarker: [`$className`](" +
78-
"https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/" +
80+
"https://github.com/typesafegithub/github-workflows-kt/blob/v$LIB_VERSION/github-workflows-kt/src/gen/kotlin/io/github/" +
7981
"typesafegithub/workflows/actions/$packageName/$className.kt)"
8082
}
8183

buildSrc/src/main/kotlin/buildsrc/convention/duplicate-versions.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ val validateDuplicatedVersion by tasks.registering(Task::class) {
1212

1313
doLast {
1414
require(
15-
rootDir.resolve("mkdocs.yml").readText()
16-
.contains(" version: $version")
15+
rootDir.resolve("automation/code-generator/src/main/kotlin/io/github/typesafegithub/workflows/codegenerator/ActionsDocsGeneration.kt").readText()
16+
.contains("private const val LIB_VERSION = \"$version\"")
1717
) { "Library version stated in the docs should be equal to $version!" }
1818
require(
1919
rootDir.resolve("github-workflows-kt/src/test/kotlin/io/github/typesafegithub/workflows/docsnippets/GettingStartedSnippets.kt").readText()

docs/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
mkdocs==1.6.0
2-
mkdocs-markdownextradata-plugin==0.2.5
32
mkdocs-material==9.5.30
43
mkdocs-material-extensions==1.3.1
54
mkdocs-video==1.5.0

0 commit comments

Comments
 (0)