-
Notifications
You must be signed in to change notification settings - Fork 3
92 lines (80 loc) · 3 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Publish
on:
push:
tags: [ 'v*' ]
branches: [ main ]
jobs:
publish:
runs-on: macos-latest
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 }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Cache Build files
uses: actions/cache@v4
if: ${{ !startsWith(matrix.os, 'windows') }}
with:
path: |
~/.konan
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}-v1
- uses: gradle/[email protected]
name: Publish
with:
arguments: clean publishAllPublicationsToMavenCentralRepository
publish-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
submodules: true
fetch-depth: 0
- name: Cache Build files
uses: actions/cache@v4
with:
path: |
~/.konan
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
architecture: x64
cache: 'pip'
cache-dependency-path: 'docs/requirements.txt'
- name: Install Python dependencies
run: python3 -m pip install -r ./docs/requirements.txt
- uses: gradle/[email protected]
name: Build KDocs
with:
arguments: clean dokkaHtmlMultiModule
- name: Move KDoc build
run: mv build/dokka/htmlMultiModule docs/kdoc
- name: Deploy with mike (release)
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=${GITHUB_REF_NAME#v} mike deploy --update-aliases --push ${{ github.ref_name }} latest
- name: Deploy with mike (snapshot)
if: startsWith(github.ref, 'refs/tags/v') == false
run: |
mike delete $(mike list | grep '\[dev-snapshot\]' | awk '{printf "%s", $1}') || true
export SNAPSHOT_VERSION=$(grep "version=" gradle.properties | cut -d '=' -f2)
VERSION=$SNAPSHOT_VERSION mike deploy --update-aliases --push "v$SNAPSHOT_VERSION" dev-snapshot