From 6886f3314cbf01084bea7308aa78cb9714457721 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Mon, 2 Sep 2024 09:27:07 +0200 Subject: [PATCH 1/3] Add api docs --- .github/workflows/dokka.yml | 58 +++++++++++++++++++++++++++++++++++ assets/logo-icon.svg | 48 +++++++++++++++++++++++++++++ designsystem/build.gradle.kts | 20 ++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 .github/workflows/dokka.yml create mode 100644 assets/logo-icon.svg diff --git a/.github/workflows/dokka.yml b/.github/workflows/dokka.yml new file mode 100644 index 000000000..ea776bdd0 --- /dev/null +++ b/.github/workflows/dokka.yml @@ -0,0 +1,58 @@ +name: Deploy API docs + +on: + push: + branches: + - main + + pull_request: + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + cache: 'gradle' + - name: Change wrapper permission + run: chmod +x ./gradlew + + - name: Build Java docs + run: ./gradlew :designsystem:dokkaHtml -PremoveSnapshotSuffix + + - name: Organize pages structure + run: | + mkdir _site && mkdir _site/api + cp -r designsystem/build/dokka/html/* _site/api + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/assets/logo-icon.svg b/assets/logo-icon.svg new file mode 100644 index 000000000..423ad405d --- /dev/null +++ b/assets/logo-icon.svg @@ -0,0 +1,48 @@ + + + + + + + + + + diff --git a/designsystem/build.gradle.kts b/designsystem/build.gradle.kts index 11d614fda..86da7ef40 100644 --- a/designsystem/build.gradle.kts +++ b/designsystem/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.dokka.gradle.DokkaTask + version = rootProject.version group = rootProject.group @@ -81,3 +83,21 @@ android { jvmToolchain(17) } } + +tasks.withType(DokkaTask::class).configureEach { + dokkaSourceSets { + configureEach { + moduleName.set("Mobile UI") + } + } + val dokkaBaseConfiguration = """ + { + "customAssets": ["${file("../assets/logo-icon.svg")}"] + } + """ + pluginsMapConfiguration.set( + mapOf( + "org.jetbrains.dokka.base.DokkaBase" to dokkaBaseConfiguration + ) + ) +} From e07d7f6f6f8265f3051c1e09c4bce9a066a10108 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Mon, 2 Sep 2024 09:56:35 +0200 Subject: [PATCH 2/3] Remove on_pull_request trigger --- .github/workflows/dokka.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/dokka.yml b/.github/workflows/dokka.yml index ea776bdd0..05ebb05a2 100644 --- a/.github/workflows/dokka.yml +++ b/.github/workflows/dokka.yml @@ -5,8 +5,6 @@ on: branches: - main - pull_request: - workflow_dispatch: permissions: From 68195bed90939f1cc9f813390cf87261546fc210 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Mon, 2 Sep 2024 11:26:18 +0200 Subject: [PATCH 3/3] Change icon --- .github/workflows/dokka.yml | 1 + assets/logo-icon.svg | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dokka.yml b/.github/workflows/dokka.yml index 05ebb05a2..b8b90265c 100644 --- a/.github/workflows/dokka.yml +++ b/.github/workflows/dokka.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - docs workflow_dispatch: diff --git a/assets/logo-icon.svg b/assets/logo-icon.svg index 423ad405d..31b81acc1 100644 --- a/assets/logo-icon.svg +++ b/assets/logo-icon.svg @@ -4,9 +4,9 @@