Skip to content

Commit

Permalink
Docs publishing prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
shanshin committed Feb 17, 2024
1 parent e80c83c commit b55d780
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 8 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Publish release docs

on:
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
prepare:
name: Prepare docs
runs-on: ubuntu-latest
steps:
- name: Prepare and collect all docs by Dokka
uses: actions/checkout@v3
with:
path: kover
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
cache: 'maven'
- uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Build docs
run: ./gradlew releaseDocs
working-directory: "./kover"
build:
name: Generate jekyll docs
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build
uses: actions/jekyll-build-pages@v1
with:
source: "./kover/docs"
destination: "./docs-generated"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./docs-generated"
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
1 change: 0 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
remote_theme: pages-themes/[email protected]
lsi: false
safe: true
source: /
highlighter: rouge
incremental: false
gist:
Expand Down
3 changes: 0 additions & 3 deletions docs/index.md

This file was deleted.

14 changes: 14 additions & 0 deletions kover-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,17 @@ tasks.jar {
repositories {
mavenCentral()
}

tasks.register("releaseDocs") {
val dirName = "cli"
val description = "Kover Command Line Interface"
val sourceDir = projectDir.resolve("docs")
val resultDir = rootDir.resolve("docs/$dirName")
val mainIndexFile = rootDir.resolve("docs/index.md")

doLast {
resultDir.mkdirs()
sourceDir.copyRecursively(resultDir)
mainIndexFile.appendText("- [$description]($dirName)\n")
}
}
File renamed without changes.
22 changes: 18 additions & 4 deletions kover-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,9 @@ afterEvaluate {

tasks.dokkaHtml {
moduleName.set("Kover Gradle Plugin")
outputDirectory.set(rootProject.layout.projectDirectory.dir("docs/gradle-plugin/dokka").asFile)
outputDirectory.set(projectDir.resolve("docs/dokka"))

if (project.hasProperty("releaseVersion")) {
moduleVersion.set(project.property("releaseVersion") as String)
}
moduleVersion.set(project.property("kover.release.version").toString())

dokkaSourceSets.configureEach {
// source set configuration section
Expand All @@ -165,6 +163,22 @@ tasks.dokkaHtml {
}
}

tasks.register("releaseDocs") {
val dirName = "gradle-plugin"
val description = "Kover Gradle Plugin"
val sourceDir = projectDir.resolve("docs")
val resultDir = rootDir.resolve("docs/$dirName")
val mainIndexFile = rootDir.resolve("docs/index.md")

dependsOn(tasks.dokkaHtml)

doLast {
resultDir.mkdirs()
sourceDir.copyRecursively(resultDir)
mainIndexFile.appendText("- [$description]($dirName)\n")
}
}

extensions.configure<Kover_publishing_conventions_gradle.KoverPublicationExtension> {
description.set("Kover Gradle Plugin - Kotlin code coverage")
//`java-gradle-plugin` plugin already creates publication with name `pluginMaven`
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes.
14 changes: 14 additions & 0 deletions kover-offline-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,17 @@ tasks.jar {
exclude("classpath.index")
}
}

tasks.register("releaseDocs") {
val dirName = "offline-instrumentation"
val description = "Kover offline instrumentation"
val sourceDir = projectDir.resolve("docs")
val resultDir = rootDir.resolve("docs/$dirName")
val mainIndexFile = rootDir.resolve("docs/index.md")

doLast {
resultDir.mkdirs()
sourceDir.copyRecursively(resultDir)
mainIndexFile.appendText("- [$description]($dirName)\n")
}
}
File renamed without changes.

0 comments on commit b55d780

Please sign in to comment.