Skip to content

Kotlin

How json2vars-setter handles Kotlin, and how the example workflow provisions it.

json2vars-setter integration

Item Value
Matrix JSON key versions.kotlin
Action output versions_kotlin
Dynamic-update strategy input kotlin-strategy (stable / latest / both)
Version source see Version Sources

Supported runners

The example matrix runs on Ubuntu / macOS:

ubuntu-latest, macos-latest

Any GitHub-hosted runner the setup action supports also works - the OS list is just the os array in your matrix JSON.

Supported versions

Example matrix (what the example workflow runs):

1
2
3
4
5
6
7
8
{
  "versions": {
    "kotlin": [
      "2.4.0",
      "2.3.10"
    ]
  }
}

Latest values tracked by the dynamic-update tooling (auto-refreshed from the release APIs into the version cache):

Field Version
stable 2.3.21
latest 2.4.0

Cache last updated: 2026-06-24T12:28:46.782780.

Setup action (example workflow)

kotlin_test.yml provisions Kotlin with the matrix value json2vars-setter produced:

- name: Set up Kotlin ${{ matrix.kotlin-version }}
  shell: bash
  run: |
    version="${{ matrix.kotlin-version }}"
    base="https://github.com/JetBrains/kotlin/releases/download/v${version}"
    curl -fsSL -o kotlin-compiler.zip "${base}/kotlin-compiler-${version}.zip"
    curl -fsSL -o kotlin-compiler.zip.sha256 "${base}/kotlin-compiler-${version}.zip.sha256"
    echo "$(cat kotlin-compiler.zip.sha256)  kotlin-compiler.zip" | shasum -a 256 -c -
    unzip -q kotlin-compiler.zip -d "$HOME/kotlin"
    echo "$HOME/kotlin/kotlinc/bin" >> "$GITHUB_PATH"

Note: There is no official Kotlin setup action, so the workflow downloads the exact kotlin-compiler-<version>.zip from the matching JetBrains release, verifies its published SHA-256, and adds kotlinc to PATH.

References