From 89a472c717676abd38e40e117cb1508757092d85 Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:16:56 -0400 Subject: [PATCH 01/10] Dokka html --- build.gradle.kts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 0309967b2..e7e0da3f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,14 @@ import io.gitlab.arturbosch.detekt.Detekt +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.gradle.DokkaTaskPartial +import java.net.URL plugins { id("org.jetbrains.kotlin.jvm") version "1.9.0" id("java-library") id("io.gitlab.arturbosch.detekt") version "1.23.1" `maven-publish` + id("org.jetbrains.dokka") version "1.9.0" } repositories { @@ -26,6 +30,7 @@ subprojects { plugin("org.jetbrains.kotlin.jvm") plugin("java-library") plugin("maven-publish") + plugin("org.jetbrains.dokka") } tasks.withType().configureEach { @@ -58,4 +63,29 @@ subprojects { } } } + + tasks.withType().configureEach { + dokkaSourceSets.configureEach { + documentedVisibilities.set( + setOf( + DokkaConfiguration.Visibility.PUBLIC, + DokkaConfiguration.Visibility.PROTECTED + ) + ) + + sourceLink { + val exampleDir = "https://github.com/TBD54566975/web5-sdk-kotlin/tree/main" + + localDirectory.set(rootProject.projectDir) + remoteUrl.set(URL(exampleDir)) + remoteLineSuffix.set("#L") + } + } + } +} + +// Configures only the parent MultiModule task, +// this will not affect subprojects +tasks.dokkaHtmlMultiModule { + moduleName.set("Web5 SDK Documentation") } \ No newline at end of file From becd9178606e0eb463a7b4ad8d33f86e810f7e37 Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:17:06 -0400 Subject: [PATCH 02/10] Attempt publishing --- .github/workflows/gh-pages-deploy.yml | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/gh-pages-deploy.yml diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml new file mode 100644 index 000000000..a246360ab --- /dev/null +++ b/.github/workflows/gh-pages-deploy.yml @@ -0,0 +1,48 @@ +name: Deploy examples to GitHub Pages + +on: + push: + branches: + - main + +jobs: + build-web5-sdk-kotlin: + runs-on: ubuntu-latest + strategy: + matrix: + projects: [ + web5-sdk-kotlin + ] + steps: + - uses: actions/checkout@v3 + - 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 html + run: ./gradlew dokkaHtmlMultiModule --no-daemon --stacktrace + working-directory: . + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.projects }} + path: ${{ matrix.projects }}/build/dokka + + deploy-examples: + runs-on: ubuntu-latest + needs: [ build-web5-sdk-kotlin ] + steps: + - uses: actions/download-artifact@v2 + with: + path: public + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + keep_files: true + publish_dir: ./public + full_commit_message: Publish documentation to GitHub pages \ No newline at end of file From 9c44184bb0fb71bfc47d878090d38ff90458d9ae Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:22:01 -0400 Subject: [PATCH 03/10] Run on PRs to this branch --- .github/workflows/gh-pages-deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index a246360ab..fbffb182a 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - dokka jobs: build-web5-sdk-kotlin: From 62fc222d5cae96b8ad7221b655b1826c3aa8e723 Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:22:53 -0400 Subject: [PATCH 04/10] Run on PRs to main --- .github/workflows/gh-pages-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index fbffb182a..ddfb9fe01 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -6,7 +6,7 @@ on: - main pull_request: branches: - - dokka + - main jobs: build-web5-sdk-kotlin: From dcac1b7696ed40e7da81f77f9f1598fbbec7b87a Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:23:05 -0400 Subject: [PATCH 05/10] Run on PRs to anything --- .github/workflows/gh-pages-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index ddfb9fe01..ae851810d 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -6,7 +6,7 @@ on: - main pull_request: branches: - - main + - '*' jobs: build-web5-sdk-kotlin: From 810b6627e4ebc2e8f2205e104f65aeb900e76198 Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:25:18 -0400 Subject: [PATCH 06/10] remove other java setup stuff --- .github/workflows/gh-pages-deploy.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index ae851810d..8afc9c990 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -20,9 +20,7 @@ jobs: - uses: actions/checkout@v3 - 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 From d2ce5fcc3be254a361853dced0cbb922858d719d Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:26:07 -0400 Subject: [PATCH 07/10] downgrade cuz this one works --- .github/workflows/gh-pages-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index 8afc9c990..18a3bcf42 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -18,7 +18,7 @@ jobs: ] steps: - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v1 with: java-version: 17 - uses: gradle/gradle-build-action@v2 From 6ef1c81749286e1024db26d3dae501890db798e3 Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:33:25 -0400 Subject: [PATCH 08/10] upload to the rigth palce --- .github/workflows/gh-pages-deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index 18a3bcf42..562c32998 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -30,8 +30,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: ${{ matrix.projects }} - path: ${{ matrix.projects }}/build/dokka + path: build/dokka deploy-examples: runs-on: ubuntu-latest From 7a5c390fce58bd9725e2dcedaf95b5361de2daff Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 12:59:20 -0400 Subject: [PATCH 09/10] final beaut touches --- .github/workflows/gh-pages-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index 562c32998..753f3c116 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -30,6 +30,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: + name: docs path: build/dokka deploy-examples: From 51ab34faf35ab821a90fae9318f79a3334a4be62 Mon Sep 17 00:00:00 2001 From: Andres Uribe Gonzalez Date: Wed, 27 Sep 2023 13:05:03 -0400 Subject: [PATCH 10/10] Only after pushing to main. --- .github/workflows/gh-pages-deploy.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/gh-pages-deploy.yml b/.github/workflows/gh-pages-deploy.yml index 753f3c116..49a7a1819 100644 --- a/.github/workflows/gh-pages-deploy.yml +++ b/.github/workflows/gh-pages-deploy.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - '*' jobs: build-web5-sdk-kotlin: