Skip to content

Commit

Permalink
fix(docs): use lib's version for docs directly (#1551)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
krzema12 authored Jul 29, 2024
1 parent 00a65ee commit aeeea11
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ internal fun deleteListOfBindingsInDocs() {

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

private const val LIB_VERSION = "2.2.1-SNAPSHOT"

private fun Pair<ActionBindingRequest, ActionBinding>.toMarkdownLinkToKotlinCode(
packageName: String,
className: String,
): String {
val typingsMarker = if (this.second.typingActualSource == TypingActualSource.ACTION) "" else ""
return "${this.first.actionCoords.version}$typingsMarker: [`$className`](" +
"https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/" +
"https://github.com/typesafegithub/github-workflows-kt/blob/v$LIB_VERSION/github-workflows-kt/src/gen/kotlin/io/github/" +
"typesafegithub/workflows/actions/$packageName/$className.kt)"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ val validateDuplicatedVersion by tasks.registering(Task::class) {

doLast {
require(
rootDir.resolve("mkdocs.yml").readText()
.contains(" version: $version")
rootDir.resolve("automation/code-generator/src/main/kotlin/io/github/typesafegithub/workflows/codegenerator/ActionsDocsGeneration.kt").readText()
.contains("private const val LIB_VERSION = \"$version\"")
) { "Library version stated in the docs should be equal to $version!" }
require(
rootDir.resolve("github-workflows-kt/src/test/kotlin/io/github/typesafegithub/workflows/docsnippets/GettingStartedSnippets.kt").readText()
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
mkdocs==1.6.0
mkdocs-markdownextradata-plugin==0.2.5
mkdocs-material==9.5.30
mkdocs-material-extensions==1.3.1
mkdocs-video==1.5.0
Expand Down
Loading

0 comments on commit aeeea11

Please sign in to comment.