From d9aae4ddbc8e1214634ee6c6f136cb1bd0975a34 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 19:51:05 +0000 Subject: [PATCH 1/4] chore(deps): update upgrade all gradle dependencies --- build.gradle.kts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e2f8b76..1cc7413 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - kotlin("multiplatform") version "2.1.21" - kotlin("plugin.serialization") version "2.1.21" + kotlin("multiplatform") version "2.3.20" + kotlin("plugin.serialization") version "2.3.20" id("io.kotest.multiplatform") version "5.9.1" id("org.jlleitschuh.gradle.ktlint") version "12.3.0" } @@ -49,15 +49,15 @@ kotlin { val commonMain by getting { dependencies { // CLI - implementation("com.github.ajalt.clikt:clikt:5.0.3") + implementation("com.github.ajalt.clikt:clikt:5.1.0") // Date Time Support - implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2") + implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1-0.6.x-compat") // Serialization - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0") // Atomic - implementation("org.jetbrains.kotlinx:atomicfu:0.28.0") + implementation("org.jetbrains.kotlinx:atomicfu:0.32.1") // Http Client - val ktorVersion = "3.2.0" + val ktorVersion = "3.4.2" implementation("io.ktor:ktor-client-core:$ktorVersion") implementation("io.ktor:ktor-client-curl:$ktorVersion") implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion") From 2dc5a7488bfec72706dd47fa1d7da061fbf65b14 Mon Sep 17 00:00:00 2001 From: Morten Andersen Date: Tue, 21 Apr 2026 10:01:45 +0200 Subject: [PATCH 2/4] build: rename KMP target from "common" to "host" to fix Gradle warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The target name "common" caused its compilation default source set to clash with KMP's reserved commonMain shared source set, producing several warnings about invalid hierarchy template configuration and illegal dependsOn edges. Renaming to "host" makes commonMain a regular shared source set again and lets the hierarchy template work correctly. Also removed the io.kotest.multiplatform plugin and its test dependencies — the project has no tests and the plugin was failing the build. Binary output paths change from build/bin/common/ to build/bin/host/; workflow files and CLAUDE.md updated accordingly. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/publish.yaml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/test.yaml | 2 +- CLAUDE.md | 19 +++++---------- build.gradle.kts | 37 ++++++++---------------------- 5 files changed, 19 insertions(+), 43 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 8c7351c..0150803 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -85,7 +85,7 @@ jobs: run: ./gradlew buildAllLinuxBinaries - name: Prepare release binaries run: | - cp build/bin/common/releaseExecutable/slack-notifier-cli.kexe ./slack-notifier-cli-X64 + cp build/bin/host/releaseExecutable/slack-notifier-cli.kexe ./slack-notifier-cli-X64 cp build/bin/linuxArm64/releaseExecutable/slack-notifier-cli.kexe ./slack-notifier-cli-ARM64 chmod +x ./slack-notifier-cli-X64 ./slack-notifier-cli-ARM64 - name: Upload x64 executable diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 5570886..faf37d8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -22,7 +22,7 @@ jobs: sudo apt update sudo apt install libcurl4-openssl-dev - name: Build with Gradle - run: ./gradlew allTests + run: ./gradlew buildAllLinuxBinaries static-code-analysis: name: Static Code Analysis runs-on: ubuntu-latest diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 14db736..89886ef 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,7 +31,7 @@ jobs: run: ./gradlew buildAllLinuxBinaries - name: Prepare binaries run: | - cp build/bin/common/releaseExecutable/slack-notifier-cli.kexe ./slack-notifier-cli-X64 + cp build/bin/host/releaseExecutable/slack-notifier-cli.kexe ./slack-notifier-cli-X64 cp build/bin/linuxArm64/releaseExecutable/slack-notifier-cli.kexe ./slack-notifier-cli-ARM64 chmod +x ./slack-notifier-cli-X64 ./slack-notifier-cli-ARM64 - name: Upload x64 executable diff --git a/CLAUDE.md b/CLAUDE.md index ed9a40d..0a2f5d1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,18 +9,12 @@ This is a Kotlin Multiplatform CLI application for sending Slack notifications, ## Key Commands ### Building and Development -- `./gradlew build` - Full build including compilation and tests -- `./gradlew commonBinaries` - Build native executables (default task) -- `./gradlew linkReleaseExecutableCommon` - Build release executable -- `./gradlew linkDebugExecutableCommon` - Build debug executable +- `./gradlew hostBinaries` - Build native executables for current host (default task) +- `./gradlew buildAllLinuxBinaries` - Build release executable ### Running -- `./gradlew runDebugExecutableCommon` - Run debug executable -- `./gradlew runReleaseExecutableCommon` - Run release executable - -### Testing -- `./gradlew commonTest` - Run tests for common target -- `./gradlew allTests` - Run all tests with aggregated report +- `./gradlew runDebugExecutableHost` - Run debug executable +- `./gradlew runReleaseExecutableHost` - Run release executable ### Code Quality - `./gradlew ktlintCheck` - Run linting @@ -52,12 +46,11 @@ This is a Kotlin Multiplatform CLI application for sending Slack notifications, - **Ktor**: HTTP client for Slack API calls - **kotlinx-serialization**: JSON parsing for GitHub events - **kotlinx-datetime**: Date/time handling -- **Kotest**: Testing framework ## Development Notes ### Platform Targeting -The project uses cross-compilation with a single "common" target that maps to the host platform. The native target selection happens at build time based on OS detection. +The project uses cross-compilation with a single "host" target that maps to the current build machine's platform. The native target selection happens at build time based on OS detection. ### GitHub Integration The CLI is designed to run in GitHub Actions and expects specific environment variables (GITHUB_EVENT_PATH, GITHUB_REPOSITORY, etc.). Event parsing handles multiple GitHub webhook formats through dedicated serializers. @@ -65,4 +58,4 @@ The CLI is designed to run in GitHub Actions and expects specific environment va ### Usage Context This tool is typically used indirectly through: 1. [slack-notifier-cli-action](https://github.com/monta-app/slack-notifier-cli-action) - GitHub Action wrapper -2. [github-workflows](https://github.com/monta-app/github-workflows) - Shared workflow templates \ No newline at end of file +2. [github-workflows](https://github.com/monta-app/github-workflows) - Shared workflow templates diff --git a/build.gradle.kts b/build.gradle.kts index 1cc7413..d8d776f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,6 @@ plugins { kotlin("multiplatform") version "2.3.20" kotlin("plugin.serialization") version "2.3.20" - id("io.kotest.multiplatform") version "5.9.1" id("org.jlleitschuh.gradle.ktlint") version "12.3.0" } @@ -12,21 +11,21 @@ repositories { mavenCentral() } -defaultTasks("commonBinaries") +defaultTasks("hostBinaries") kotlin { val hostOs = System.getProperty("os.name") // Host target (always matches the build machine) - val commonTarget = when { - hostOs == "Mac OS X" -> macosArm64("common") - hostOs == "Linux" -> linuxX64("common") - hostOs.startsWith("Windows") -> mingwX64("common") + val hostTarget = when { + hostOs == "Mac OS X" -> macosArm64("host") + hostOs == "Linux" -> linuxX64("host") + hostOs.startsWith("Windows") -> mingwX64("host") else -> throw GradleException("Host OS is not supported in Kotlin/Native.") } - commonTarget.apply { + hostTarget.apply { binaries { executable { entryPoint = "com.monta.slack.notifier.main" @@ -46,7 +45,7 @@ kotlin { } sourceSets { - val commonMain by getting { + commonMain { dependencies { // CLI implementation("com.github.ajalt.clikt:clikt:5.1.0") @@ -64,22 +63,6 @@ kotlin { implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion") } } - val commonTest by getting { - dependencies { - val kotestVersion = "5.9.1" - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation("io.kotest:kotest-framework-engine:$kotestVersion") - implementation("io.kotest:kotest-assertions-core:$kotestVersion") - } - } - - // Configure linuxArm64 to share the same source set - if (hostOs == "Linux") { - val linuxArm64Main by getting { - dependsOn(commonMain) - } - } } } @@ -89,7 +72,7 @@ kotlin.targets.withType Date: Tue, 21 Apr 2026 10:02:50 +0200 Subject: [PATCH 3/4] ignore: Formatting (missing line end) --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index d8d776f..8d90af4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -82,4 +82,4 @@ if (isLinux) { description = "Build binaries for both Linux x64 and ARM64" dependsOn("linkReleaseExecutableHost", "linkReleaseExecutableLinuxArm64") } -} \ No newline at end of file +} From 2f7271f9595c5564944e0f8bf96ab447b59bd13d Mon Sep 17 00:00:00 2001 From: Morten Andersen Date: Tue, 21 Apr 2026 10:10:34 +0200 Subject: [PATCH 4/4] ci: migrate runners to linux-arm64 and upgrade JDK to 25 Standardise all workflow jobs on the linux-arm64 runner and bump the JDK version to 25 with the Corretto distribution, consistent with the existing publish and test workflows. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/claude.yml | 2 +- .github/workflows/publish.yaml | 4 ++-- .github/workflows/pull-request.yml | 8 ++++---- .github/workflows/test.yaml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 1681040..4e1dcdb 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -17,7 +17,7 @@ jobs: (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) - runs-on: ubuntu-latest + runs-on: linux-arm64 permissions: contents: read pull-requests: write diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 0150803..daa2841 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -26,7 +26,7 @@ permissions: jobs: create-tag-and-build: - runs-on: linux-x64 + runs-on: linux-arm64 outputs: new_version: ${{ steps.create_tag.outputs.new_version }} steps: @@ -70,7 +70,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v5 with: - java-version: '21' + java-version: '25' distribution: 'corretto' cache: 'gradle' - uses: actions/cache@v5 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index faf37d8..9785545 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -4,14 +4,14 @@ on: [ pull_request ] jobs: build: - runs-on: ubuntu-latest + runs-on: linux-arm64 steps: - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 with: - java-version: '17' - distribution: 'adopt' + java-version: '25' + distribution: 'corretto' cache: 'gradle' - uses: actions/cache@v5 with: @@ -25,7 +25,7 @@ jobs: run: ./gradlew buildAllLinuxBinaries static-code-analysis: name: Static Code Analysis - runs-on: ubuntu-latest + runs-on: linux-arm64 timeout-minutes: 30 steps: - name: Run detekt diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 89886ef..3941649 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,13 +10,13 @@ permissions: jobs: build: - runs-on: linux-x64 + runs-on: linux-arm64 steps: - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 with: - java-version: '21' + java-version: '25' distribution: 'corretto' cache: 'gradle' - uses: actions/cache@v5