From 6e5d129d818288e965ebd7d14c14b8e7c79d29d7 Mon Sep 17 00:00:00 2001 From: C10udburst <18114966+C10udburst@users.noreply.github.com> Date: Sat, 13 Aug 2022 16:09:08 +0200 Subject: [PATCH] generate dokka --- .github/workflows/generate_dokka.yml | 59 ++++++++++++++++++++++++++++ app/build.gradle | 1 + build.gradle | 1 + 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/generate_dokka.yml diff --git a/.github/workflows/generate_dokka.yml b/.github/workflows/generate_dokka.yml new file mode 100644 index 00000000..e4f671bd --- /dev/null +++ b/.github/workflows/generate_dokka.yml @@ -0,0 +1,59 @@ +name: Build + +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency +concurrency: + group: "build" + cancel-in-progress: true + +on: + push: + branches: + # choose your default branch + - master + - main + paths-ignore: + - '*.md' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + with: + path: "src" + + - name: Checkout dokka + uses: actions/checkout@master + with: + ref: "dokka" + path: "dokka" + + - name: Clean old builds + run: rm -rf $GITHUB_WORKSPACE/src/html/* + + - name: Setup JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Generate Dokka + run: | + cd src + ./gradlew Aliucord:dokkaHtml + + - name: Copy Dokka + run: | + cp -r dokka/html $GITHUB_WORKSPACE/dokka/ + + - name: Push builds + run: | + cd $GITHUB_WORKSPACE/dokka + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + git add . + git commit --amend -m "Generate dokka for $GITHUB_SHA" || exit 0 # do not error if nothing to commit + git push --force \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 875361ed..8594bd79 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,6 +3,7 @@ plugins { id 'kotlin-android' id 'kotlin-kapt' id 'kotlin-android-extensions' + id 'org.jetbrains.dokka' } def tmpFilePath = System.getProperty("user.home") + "/work/_temp/keystore/" diff --git a/build.gradle b/build.gradle index be01c63b..90f9ac32 100644 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.5.0" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files