From a235167b89ff57ab2df6e5c2481aa56601869fee Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 30 Aug 2020 16:10:44 +0100 Subject: [PATCH] Publish KDoc to docs.openrs2.dev Signed-off-by: Graham --- .drone.yml | 5 +++++ build.gradle.kts | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.drone.yml b/.drone.yml index 898231d2..8d1c055f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,12 +11,17 @@ steps: - name: deploy image: registry.openrs2.dev/openrs2-dev commands: + - install -dm0700 $${HOME}/.ssh + - echo -n "$${SSH_KEY}" > $${HOME}/.ssh/id_ed25519 + - chmod 0600 $${HOME}/.ssh/id_ed25519 - ./gradlew --no-daemon publish environment: ORG_GRADLE_PROJECT_openrs2Username: from_secret: repo_username ORG_GRADLE_PROJECT_openrs2Password: from_secret: repo_password + SSH_KEY: + from_secret: ssh_key when: branch: - master diff --git a/build.gradle.kts b/build.gradle.kts index 95ebd03b..12a47db5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -293,6 +293,10 @@ configure(subprojects.filter { it.isFree }) { } } +tasks.build { + dependsOn(":dokkaHtmlCollector") +} + val rejectVersionRegex = Regex("(?i)[._-](?:alpha|beta|rc|cr|m|dev)") tasks.dependencyUpdates { @@ -304,6 +308,23 @@ tasks.dependencyUpdates { } } +tasks.register("publish") { + dependsOn("publishDokka") +} + +tasks.register("publishDokka") { + dependsOn(":dokkaHtmlCollector") + + commandLine( + "rsync", + "-e", + "ssh -oStrictHostKeyChecking=accept-new", + "-rtz", + "$buildDir/dokka/htmlCollector/", + "build@docs.openrs2.dev:/srv/www/docs" + ) +} + tasks.wrapper { distributionType = Wrapper.DistributionType.ALL }