Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Verify Docs Changelog

on:
pull_request:

permissions:
contents: read

jobs:
verify-platforms-table:
name: Run Verification
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Check Platforms Table
run: ./gradlew updateDocsChangelog --info --stacktrace

- name: Check if changelog is up-to-date
run: |
if [[ -n "$(git status --porcelain | grep docs/pages/kotlinx-rpc/topics/changelog.md)" ]]; then
echo "Changelog is not up to date. Please run './gradlew updateDocsChangelog' and commit changes"
exit 1
fi
76 changes: 46 additions & 30 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- 'docs/pages/**'
- '.github/workflows/**'
workflow_dispatch:
inputs:
version:
description: 'Version of library that is being documented'
required: true

permissions:
id-token: write
Expand All @@ -21,6 +25,9 @@ env:
ALGOLIA_KEY: '${{ secrets.ALGOLIA_KEY }}'
CONFIG_JSON_PRODUCT: 'kotlinx-rpc'
CONFIG_JSON_VERSION: '0.8.0'
DOKKA_ARTIFACT: 'dokka.zip'
ASSEMBLE_DIR: '__docs_assembled'
ASSEMBLE_ARTIFACT: 'assembled.zip'

jobs:
build:
Expand All @@ -31,9 +38,6 @@ jobs:
with:
fetch-depth: 0

- name: Create stub changelog.md file
run: echo "# Changelog" > docs/pages/kotlinx-rpc/topics/changelog.md

- name: Build docs using Writerside Docker builder
uses: JetBrains/writerside-github-action@v4
with:
Expand Down Expand Up @@ -67,11 +71,8 @@ jobs:
with:
instance: ${{ env.INSTANCE }}

deploy:
assemble:
if: github.event_name == 'workflow_dispatch'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: [ build, test ]
runs-on: ubuntu-latest
steps:
Expand All @@ -80,58 +81,73 @@ jobs:
with:
fetch-depth: 0

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Run Dokka
run: ./gradlew dokkaGenerate
- name: Download Writerside artifacts
uses: actions/download-artifact@v4
with:
name: kotlinx-rpc

- name: Move API docs to the publication directory
run:
mkdir __docs_publication_dir
cp -r docs/pages/api __docs_publication_dir/api
- name: Unzip Writerside artifacts
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}

- name: Download artifacts
- name: Download Dokka
uses: actions/download-artifact@v4
with:
name: kotlinx-rpc
name: dokka-${{ inputs.version }}
path: ${{ env.DOKKA_ARTIFACT }}

- name: Unzip artifact
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT }}' -d __docs_publication_dir
- name: Unzip Dokka
run: unzip -O UTF-8 -qq '${{ env.DOKKA_ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}/api

- name: Update sitemap.xml
run: chmod +x updateSitemap.sh && ./updateSitemap.sh __docs_publication_dir/sitemap.xml __docs_publication_dir/api
run: chmod +x updateSitemap.sh && ./updateSitemap.sh ${{ env.ASSEMBLE_DIR }}/sitemap.xml ${{ env.ASSEMBLE_DIR }}/api

- name: Run Changelog Generator
run: ./gradlew updateDocsChangelog
- name: Save assembled artifact
uses: actions/upload-artifact@v4
with:
name: kotlinx-rpc-assembled
path: |
${{ env.ASSEMBLE_DIR }}
retention-days: 7

deploy:
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: [ build, test, assemble ]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: kotlinx-rpc-assembled

- name: Move Changelog.md to the publication directory
run:
mv docs/pages/kotlinx-rpc/topics/changelog.md __docs_publication_dir/changelog.md
- name: Unzip artifact
run: unzip -O UTF-8 -qq '${{ env.ASSEMBLE_ARTIFACT }}' -d ${{ env.ASSEMBLE_DIR }}

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Package and upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: __docs_publication_dir
path: ${{ env.ASSEMBLE_DIR }}

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

publish-indexes:
if: github.event_name == 'workflow_dispatch'
needs: [ build, test, deploy ]
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
needs: [ build, test, assemble, deploy ]
runs-on: ubuntu-latest
container:
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: kotlinx-rpc
name: kotlinx-rpc-assembled
- name: Unzip artifact
run: |
unzip -O UTF-8 -qq '${{ env.ALGOLIA_ARTIFACT }}' -d algolia-indexes
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/dokka.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Store Dokka Artifact

on:
workflow_dispatch:
inputs:
version:
description: 'Version of library that is being documented'
required: true
type: string
buildId:
description: 'TeamCity build id'
required: true
type: string
artifactName:
description: 'Name of artifact to download'
required: true
type: string

jobs:
store-dokka-artifact:
name: Store Dokka Artifact
runs-on: ubuntu-latest
steps:
- name: Download Dokka artifact
run: |
curl -v -s -f -L \
-H "Authorization: Bearer ${{ secrets.TEAMCITY_TOKEN }}" \
https://krpc.teamcity.com/app/rest/builds/id:${{ inputs.buildId }}/artifacts/content/${{ inputs.artifactName }} -o dokka.zip
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: dokka-${{ inputs.version }}
path: dokka.zip
retention-days: 21
4 changes: 3 additions & 1 deletion .github/workflows/platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
steps:
- name: Checkout Sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Check Platforms Table
run: ./gradlew verifyPlatformTable --no-configuration-cache
run: ./gradlew verifyPlatformTable --no-configuration-cache --info --stacktrace
6 changes: 0 additions & 6 deletions .idea/kotlinx-rpc.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions compiler-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ kotlin.code.style=official

kotlin.native.ignoreDisabledTargets=true

kotlin.daemon.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError
kotlin.daemon.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError
kotlin.daemon.useFallbackStrategy=false

org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=768m
org.gradle.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:MaxMetaspaceSize=768m
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.workers.max=8
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configureondemand=true

org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
Expand Down
1 change: 0 additions & 1 deletion docs/pages/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
api/**
kotlinx-rpc/topics/changelog.md
Loading