Skip to content

Commit

Permalink
Fix conflicting dokka config, downgrade Gradle for Dokka, and add Git…
Browse files Browse the repository at this point in the history
…hubPages (#2942)
  • Loading branch information
nomisRev authored Feb 22, 2023
1 parent 2819987 commit 3b2a9c4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/generate-alpha-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: generate-alpha-tag

on:
push:
paths-ignore:
- 'docs/**'
branches:
- main

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/githubpages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: githubpages

on:
push:
branches:
- main

jobs:
githubpages:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.TOKEN_GITHUB_ACTION }}

- name: Dokka
id: Dokka
run: ./gradlew cleanDocs dokkaHtmlMultiModule -Pgithubpages=true

- name: Push
run: |
git add .
git commit -m "Update github pages"
git push
2 changes: 2 additions & 0 deletions .github/workflows/publish-landing-page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Publish landing page

on:
push:
paths-ignore:
- 'docs/**'
branches:
- main
paths:
Expand Down
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,20 @@ tasks {
getByName("knitPrepare").dependsOn(getTasksByName("dokka", true))

withType<DokkaMultiModuleTask>().configureEach {
outputDirectory.set(rootDir.resolve("arrow-site/docs/apidocs"))
outputDirectory.set(docFolder())
moduleName.set("Arrow")
}

register<Delete>("cleanDocs") {
val folder = rootDir.resolve("arrow-site/docs/apidocs")
val folder = docFolder()
val content = folder.listFiles()?.filter { it != folder }
delete(content)
}
}

fun docFolder(): File =
project.properties["githubpages"]?.let { file("docs").also { it.mkdir() } } ?: rootDir.resolve("arrow-site/docs/apidocs")

apiValidation {
val ignoreApiValidation = if (!enableCompatibilityMetadataVariant) {
listOf("arrow-optics-ksp-plugin", "arrow-site")
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ ROOT_PROJECT=../gradle/main.gradle
TEST_COVERAGE=../../gradle/test-coverage.gradle
ANIMALSNIFFER=../../gradle/animalsniffer.gradle
ANIMALSNIFFER_MPP=../../gradle/animalsniffer-mpp.gradle

dokkaEnabled=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 3b2a9c4

Please sign in to comment.