Skip to content

Commit

Permalink
improve ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vendelieu committed Jan 4, 2025
1 parent 5a8997e commit 5c73fd0
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 8 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Documentation

permissions:
contents: write

on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish'
required: true
type: string
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
documentation:
name: Publish documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: current

- name: Cache konan dependencies
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.toml')}}
restore-keys: |
${{ runner.os }}-gradle-
- name: Determine version
id: vars
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
fi
shell: bash

- name: Generate docs
env:
libVersion: ${{ steps.vars.outputs.version }}
run: ./gradlew dokkaGenerate

- name: Publish documentation
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
BRANCH: gh-pages
FOLDER: build/dokka/html
7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ jobs:
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{secrets.GPG_KEY_PWD}}
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-parallel

- name: Publish documentation
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
BRANCH: gh-pages
FOLDER: build/dokka

finalize:
name: Finalize
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mavenPublishing {
val javaDoc = if (releaseMode) {
signAllPublications()

JavadocJar.Dokka("dokkaGenerate")
JavadocJar.Empty()
} else JavadocJar.Empty()

configure(KotlinMultiplatform(javaDoc, true))
Expand Down

0 comments on commit 5c73fd0

Please sign in to comment.