mirror of
https://github.com/InsanusMokrassar/KSLog.git
synced 2026-11-02 17:52:55 +00:00
build: add Kotlin Toolchain migration with Gradle fallback
This commit is contained in:
1 parent
0b9fb30862
commit
4d0f039787
58 files changed
+3115
-47
No files matched your search
@@ -0,0 +1,58 @@
|
||||
name: Build and test
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
KOTLIN_CLI_NO_WELCOME_BANNER: "1"
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "17"
|
||||
cache: gradle
|
||||
- uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3
|
||||
- name: Install the declared Android SDK
|
||||
run: sdkmanager "platforms;android-37" "build-tools;37.0.0"
|
||||
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
||||
with:
|
||||
path: ~/.cache/JetBrains/Kotlin
|
||||
key: kotlin-toolchain-${{ runner.os }}-${{ hashFiles('kotlin', 'kslog/module.yaml', 'project.yaml', 'gradle/libs.versions.toml', 'plugins/**/*.yaml', 'plugins/**/*.kt') }}
|
||||
restore-keys: |
|
||||
kotlin-toolchain-${{ runner.os }}-
|
||||
- name: Check release/version consistency
|
||||
run: |
|
||||
python3 verification/check_release_consistency.py
|
||||
bash verification/test_changelog_parser.sh
|
||||
python3 verification/check_wrapper_line_endings.py
|
||||
- name: Load Kotlin Toolchain model
|
||||
run: ./kotlin show modules
|
||||
- name: Validate Gradle Dokka output overrides
|
||||
run: |
|
||||
./gradlew --no-daemon help --task dokkaHtml -PDOKKA_PATH="$RUNNER_TEMP/kslog-dokka-property"
|
||||
DOKKA_PATH="$RUNNER_TEMP/kslog-dokka-environment" ./gradlew --no-daemon help --task dokkaHtml
|
||||
- name: Build Kotlin Toolchain targets
|
||||
run: ./kotlin build
|
||||
- name: Run Kotlin Toolchain checks
|
||||
run: ./kotlin check
|
||||
- name: Build the complete retained Gradle fallback
|
||||
run: ./gradlew --no-daemon clean build
|
||||
- name: Verify isolated Gradle publication and consumers
|
||||
run: bash verification/verify_gradle_fallback.sh
|
||||
@@ -1,21 +1,71 @@
|
||||
name: Publish KDocs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: kdocs-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
KOTLIN_CLI_NO_WELCOME_BANNER: "1"
|
||||
|
||||
jobs:
|
||||
publishing:
|
||||
generate:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v1
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
with:
|
||||
java-version: 17
|
||||
- name: Build
|
||||
run: ./gradlew dokkaHtml
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "17"
|
||||
- uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3
|
||||
- name: Install the declared Android SDK
|
||||
run: sdkmanager "platforms;android-37" "build-tools;37.0.0"
|
||||
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
||||
with:
|
||||
path: ~/.cache/JetBrains/Kotlin
|
||||
key: kotlin-toolchain-${{ runner.os }}-${{ hashFiles('kotlin', 'kslog/module.yaml', 'project.yaml', 'gradle/libs.versions.toml', 'plugins/dokka/**/*.yaml', 'plugins/dokka/**/*.kt') }}
|
||||
restore-keys: |
|
||||
kotlin-toolchain-${{ runner.os }}-
|
||||
- name: Materialize platform analysis classpaths
|
||||
run: ./kotlin build -m kslog -p js -p wasmJs
|
||||
- name: Generate KDocs
|
||||
run: ./kotlin do dokkaHtml
|
||||
- name: Upload generated KDocs
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: kdocs-html
|
||||
path: build/dokka/html
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
deploy:
|
||||
needs: generate
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download generated KDocs
|
||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
|
||||
with:
|
||||
name: kdocs-html
|
||||
path: kdocs-html
|
||||
- name: Publish KDocs
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./build/dokka/html
|
||||
publish_dir: ./kdocs-html
|
||||
publish_branch: kdocs
|
||||
@@ -1,29 +0,0 @@
|
||||
name: Publish package to GitHub Packages
|
||||
on: [push]
|
||||
jobs:
|
||||
publishing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 17
|
||||
- name: Rewrite version
|
||||
run: |
|
||||
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
|
||||
cat gradle.properties | sed -e "s/^version=\([0-9\.]*\)/version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp
|
||||
rm gradle.properties
|
||||
mv gradle.properties.tmp gradle.properties
|
||||
- name: Build
|
||||
run: ./gradlew build
|
||||
- name: Publish to Gitea
|
||||
continue-on-error: true
|
||||
run: ./gradlew publishAllPublicationsToGiteaRepository
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
- name: Publish
|
||||
continue-on-error: true
|
||||
run: ./gradlew --no-parallel publishAllPublicationsToGithubPackagesRepository
|
||||
env:
|
||||
GITHUBPACKAGES_USER: ${{ github.actor }}
|
||||
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in new issue
Block a user