Skip to content

Add writerside documentation (#70) #223

Add writerside documentation (#70)

Add writerside documentation (#70) #223

Workflow file for this run

name: Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
check:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Check api
run: ./gradlew apiCheck
- name: Generate kover coverage report
run: ./gradlew koverMergedXmlReport
- name: Add coverage report to PR
if: ${{ github.event_name == 'pull_request' }}
id: kover
uses: mi-kas/kover-report@v1
continue-on-error: true # https://github.com/mi-kas/kover-report/issues/111
with:
path: ${{ github.workspace }}/build/reports/kover/merged/xml/report.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: Code Coverage
update-comment: true
min-coverage-overall: 80
min-coverage-changed-files: 80
build:
strategy:
matrix:
config: [
{ target: android, os: ubuntu-latest, tasks: testDebugUnitTest testReleaseUnitTest, continueOnError: false },
{ target: apple, os: macos-latest, tasks: iosX64Test iosSimulatorArm64Test macosX64Test macosArm64Test tvosX64Test tvosSimulatorArm64Test watchosX64Test watchosSimulatorArm64Test, continueOnError: false },
{ target: windows, os: windows-latest, tasks: windowsTest, continueOnError: true }, # https://github.com/square/okio/issues/951
{ target: linux, os: ubuntu-latest, tasks: linuxTest, continueOnError: false },
{ target: js, os: ubuntu-latest, tasks: jsTest, continueOnError: false },
{ target: desktop, os: ubuntu-latest, tasks: desktopTest, continueOnError: false },
]
runs-on: ${{ matrix.config.os }}
name: Build ${{ matrix.config.target }}
needs: check
steps:
- uses: actions/checkout@v3
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Test ${{ matrix.config.target }} targets
continue-on-error: ${{ matrix.config.continueOnError }}
run: ./gradlew ${{ matrix.config.tasks }}
release:
name: Release to Sonatype
if: ${{ github.event_name != 'pull_request' }}
runs-on: macos-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Write secrets to local.properties
if: ${{ github.event_name != 'pull_request' }}
run: |
echo sonatypeUsername="${SONATYPE_USERNAME}" >> "local.properties"
echo sonatypePassword="${SONATYPE_PASSWORD}" >> "local.properties"
echo gpgKeyPassword="${GPG_KEY_PASSWORD}" >> "local.properties"
echo gpgKeySecret="${GPG_KEY_SECRET}" >> "local.properties"
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
GPG_KEY_SECRET: ${{ secrets.GPG_KEY_SECRET }}
- name: Release to sonatype
run: ./gradlew publishAllPublicationsToMavenRepository
documentation:
name: Publish documentation
# if: ${{ github.event_name != 'pull_request' }}
runs-on: macos-latest
needs:
- build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Generate docs with dokka
run: |
./gradlew dokkaHtmlMultiModule
mv build/dokka/htmlMultiModule build/reports/docs/api
- name: Build Writerside docs using Docker
uses: JetBrains/writerside-github-action@v4
with:
instance: docs/kstore
artifact: webHelpKSTORE2-all.zip
docker-version: 232.10275
- name: Upload documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: |
artifacts/webHelpKSTORE2-all.zip
artifacts/report.json
retention-days: 7
- name: Unzip artifact
uses: montudor/action-zip@v1
with:
args: unzip -qq artifacts/webHelpKSTORE2-all.zip -d build/reports/docs
- name: Upload pages
uses: actions/upload-pages-artifact@v1
with:
name: api
path: ${{ github.workspace }}/build/reports/docs
- name: Release to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1