Skip to content

Commit

Permalink
improve doc generation
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkobor committed Jan 18, 2024
1 parent 143cab8 commit 3b19321
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
- '*'
# To make it able to run manually, TODO remove when we're sure it's working
workflow_dispatch:
env:
VERSION: "${{ github.ref_name }}"
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -26,9 +24,12 @@ jobs:
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: 'Get Previous tag'
id: lasttag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Generate API documentation
run: |
./gradlew -Pversion=$VERSION dokkaHtml
./gradlew -PdocVersion=${{ steps.lasttag.outputs.tag }} dokkaHtml
# Uploading the generated files as build artifacts
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.net.URL

plugins {
kotlin("jvm")
id("com.lovelysystems.gradle")
Expand Down Expand Up @@ -60,6 +62,20 @@ dependencies {
testImplementation(testLibs.logback)
}

tasks.dokkaHtml {
val versionToUse = (project.findProperty("docVersion") as? String?) ?: project.version.toString()
moduleVersion.set(versionToUse)
dokkaSourceSets {
named("main") {
sourceLink {
localDirectory.set(projectDir.resolve("src"))
remoteUrl.set(URL("https://github.com/lovelysystems/lovely-jooq/tree/master/src"))
remoteLineSuffix.set("#L")
}
}
}
}

publishing {
repositories {
maven {
Expand Down

0 comments on commit 3b19321

Please sign in to comment.