Skip to content

Commit

Permalink
chore(build): Auto-generate plugin api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert committed Oct 2, 2020
1 parent 6a16810 commit 3de5612
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 30 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docs_master.yml
@@ -0,0 +1,39 @@
name: Generate and Publish Docs

on:
push:
branches:
- master

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false

jobs:
generate-docs:
# Only run the root repository
if: startsWith(github.repository, 'spinnaker/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Docs
run: ./gradlew dokkaHtml --stacktrace
- name: Publish orca-api docs
uses: spinnaker/ghaction-copy-to-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.SPINNAKER_GITHUB_TOKEN }}
with:
source-directory: orca-api/build/dokka/html/
destination-github-username: spinnaker
destination-repository-name: spinnaker.github.io
destination-directory: reference/api/service-plugin-apis/orca-api/master/x
user-email: sig-docs@spinnaker.io
user-name: autodocs
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -18,8 +18,8 @@ plugins {
id 'io.spinnaker.project' version "$spinnakerGradleVersion" apply false
id "nebula.kotlin" version "$kotlinVersion" apply false
id "org.jetbrains.kotlin.plugin.allopen" version "$kotlinVersion" apply false
id "org.jetbrains.dokka" version "0.10.1" apply false
id "io.gitlab.arturbosch.detekt" version "1.7.4" apply false
id "org.jetbrains.dokka" version "1.4.10" apply false
}

allprojects {
Expand Down
11 changes: 5 additions & 6 deletions gradle/dokka.gradle
Expand Up @@ -16,11 +16,10 @@

apply plugin: "org.jetbrains.dokka"

dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/dokka"

configuration {
jdkVersion = 8
dokkaHtml {
dokkaSourceSets {
configureEach {
jdkVersion.set(11)
}
}
}
17 changes: 0 additions & 17 deletions orca-api/api.md

This file was deleted.

8 changes: 2 additions & 6 deletions orca-api/orca-api.gradle
Expand Up @@ -44,6 +44,8 @@ dependencies {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-api")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")

dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.4.10")

sampleImplementation(sourceSets.main.runtimeClasspath)
}

Expand All @@ -60,9 +62,3 @@ test {
includeEngines "junit-vintage", "junit-jupiter"
}
}

dokka {
configuration {
includes = ["api.md"]
}
}
6 changes: 6 additions & 0 deletions settings.gradle
Expand Up @@ -13,6 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pluginManagement {
repositories {
gradlePluginPortal()
jcenter()
}
}

['fiat', 'kork'].each { prj ->
String propName = "${prj}Composite"
Expand Down

0 comments on commit 3de5612

Please sign in to comment.