diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..24aef785 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,47 @@ +name: API Reference +on: + pull_request: + push: + branches: + - main + tags: + - '*' + +jobs: + build: + if: github.actor != 'dependabot[bot]' || github.event_name != 'pull_request' + runs-on: ubuntu-latest + permissions: + deployments: write + id-token: write + contents: read + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Java 17 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Set up Gradle + uses: gradle/gradle-build-action@v2 + + - name: Build Documentation + run: ./gradlew dokkaHtml + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: eu-west-2 + role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-chat-kotlin + role-session-name: "${{ github.run_id }}-${{ github.run_number }}" + + - name: Upload Documentation + uses: ably/sdk-upload-action@v2 + with: + sourcePath: chat-android/build/dokka/html + githubToken: ${{ secrets.GITHUB_TOKEN }} + artifactName: dokka diff --git a/chat-android/build.gradle.kts b/chat-android/build.gradle.kts index fba33949..4ac4fa1e 100644 --- a/chat-android/build.gradle.kts +++ b/chat-android/build.gradle.kts @@ -8,6 +8,7 @@ plugins { alias(libs.plugins.build.config) alias(libs.plugins.kover) alias(libs.plugins.maven.publish) + alias(libs.plugins.dokka) } val version = property("VERSION_NAME") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ca52090b..1e1ab967 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -63,3 +63,4 @@ compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = " build-config = { id = "com.github.gmazzo.buildconfig", version.ref = "build-config" } kover = { id = "org.jetbrains.kotlinx.kover", version = "0.9.0-RC" } maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" } +dokka = { id = "org.jetbrains.dokka", version = "1.9.20" }