Skip to content

Publish

Publish #274

Workflow file for this run

name: Publish
on:
push:
tags: [ 'v*' ]
branches: [ main ]
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
jobs:
file-changes:
runs-on: ubuntu-latest
outputs:
any: ${{ steps.check.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Get changed files
id: check
uses: tj-actions/changed-files@v45
with:
files: |
.github/workflows/publish.yml
gradle/libs.versions.toml
gradle/kotlin-js-store/**
**/*.kt
**/*.kts
publish:
name: Publish to Maven
runs-on: macos-latest
needs: [ file-changes ]
if: needs.file-changes.outputs.any == 'true' || startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/actions/setup-gradle@v4
- name: Cache Build files
uses: actions/cache@v4
with:
path: |
~/.konan
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}
- name: Publish
run: ./gradlew clean publishAllPublicationsToMavenCentralRepository
publish-docs:
name: Publish KDoc to Github Pages
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/actions/setup-gradle@v4
- name: Cache Build files
uses: actions/cache@v4
with:
path: |
~/.konan
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}
- name: Build Docs
run: ./gradlew clean dokkaHtmlMultiModule
- name: Publish Docs
uses: JamesIves/github-pages-deploy-action@v4.6.8
with:
branch: docs
folder: build/dokka/htmlMultiModule
single-commit: true