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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Validation

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: validation-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
validate:
# iOS targets build only on macOS
runs-on: macos-latest
timeout-minutes: 90

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

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

- name: Run tests and assemble
run: ./gradlew --no-daemon --stacktrace :library:allTests :library:assemble
88 changes: 88 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Release Library

on:
push:
tags:
- 'v*'

permissions:
contents: read
packages: write

jobs:
publish-library:
# iOS klibs can only be built and published from macOS
runs-on: macos-latest
environment: release

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

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

- name: Run tests
run: |
./gradlew --no-daemon --stacktrace \
:library:allTests

- name: Validate tag matches version
run: |
TAG="${GITHUB_REF#refs/tags/}"
VERSION=$(grep '^versionName=' gradle.properties | cut -d'=' -f2)
if [ "v${VERSION}" != "${TAG}" ] && [ "${VERSION}" != "${TAG}" ]; then
echo "Tag '${TAG}' does not match versionName '${VERSION}' in gradle.properties"
exit 1
fi

- name: Prepare publishing credentials
env:
NEXUS_USERTOKEN_NAME: ${{ secrets.NEXUS_USERTOKEN_NAME }}
NEXUS_USERTOKEN_PASSWORD: ${{ secrets.NEXUS_USERTOKEN_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE_BASE64: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE_BASE64 }}
run: |
required_vars=(
NEXUS_USERTOKEN_NAME
NEXUS_USERTOKEN_PASSWORD
SIGNING_KEY_ID
SIGNING_PASSWORD
SIGNING_SECRET_KEY_RING_FILE_BASE64
)

for var in "${required_vars[@]}"; do
if [ -z "${!var}" ]; then
echo "Missing required secret: ${var}"
exit 1
fi
done

keyring_file="${RUNNER_TEMP}/signing-secring.gpg"
echo "${SIGNING_SECRET_KEY_RING_FILE_BASE64}" | base64 --decode > "${keyring_file}"
chmod 600 "${keyring_file}"

mkdir -p "${HOME}/.gradle"
{
echo "mavenCentralUsername=${NEXUS_USERTOKEN_NAME}"
echo "mavenCentralPassword=${NEXUS_USERTOKEN_PASSWORD}"
echo "NEXUS_USERTOKEN_NAME=${NEXUS_USERTOKEN_NAME}"
echo "NEXUS_USERTOKEN_PASSWORD=${NEXUS_USERTOKEN_PASSWORD}"
echo "signing.keyId=${SIGNING_KEY_ID}"
echo "signing.password=${SIGNING_PASSWORD}"
echo "signing.secretKeyRingFile=${keyring_file}"
} >> "${HOME}/.gradle/gradle.properties"

- name: Publish library
run: |
./gradlew --no-daemon --stacktrace \
:library:publishAndReleaseToMavenCentral
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## 1.0.0 - 2026-11-08

First public release, published to Maven Central as `ru.kode:reactive-tasks`.

- Kotlin Multiplatform targets: JVM, Android, iOS (`iosX64`, `iosArm64`, `iosSimulatorArm64`).
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

A library for scheduling, executing and observing repeateble reactive tasks.

# Installation

Kotlin Multiplatform: JVM, Android, iOS (`iosX64`, `iosArm64`, `iosSimulatorArm64`).

```kotlin
implementation("ru.kode:reactive-tasks:1.0.0")
```

# How to use

```kotlin
Expand Down
14 changes: 14 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ kotlin.mpp.enableCInteropCommonization=true
#Android
android.useAndroidX=true
android.nonTransitiveRClass=true
#Publishing
versionName=1.0.0
pomGroupId=ru.kode
pomName=Reactive Tasks
pomDescription=Kotlin Multiplatform library for scheduling, executing and observing reactive tasks
pomUrl=https://github.com/appKODE/reactive-tasks
pomScmUrl=https://github.com/appKODE/reactive-tasks
pomScmConnection=scm:git:https://github.com/appKODE/reactive-tasks.git
pomScmDevConnection=scm:git:ssh://github.com/appKODE/reactive-tasks.git
pomLicenseName=MIT License
pomLicenseUrl=https://opensource.org/licenses/MIT
pomLicenseDist=repo
pomDeveloperId=dimsuz
pomDeveloperName=Dmitry Suzdalev
9 changes: 6 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
[versions]
agp = "8.13.0"
kotlin = "2.2.20"
agp = "9.0.1"
kotlin = "2.3.20"
android-minSdk = "24"
android-compileSdk = "36"
vanniktechMavenPublish = "0.34.0"
vanniktechMavenPublish = "0.37.0"
coroutines = "1.10.2"
atomicfu = "0.29.0"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
kotlin-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "atomicfu" }

[plugins]
android-kotlin-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
76 changes: 41 additions & 35 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.android.build.api.dsl.androidLibrary
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand All @@ -7,35 +6,25 @@ plugins {
alias(libs.plugins.vanniktech.mavenPublish)
}

group = "ru.kode.reactivetasks"
version = "1.0.0"
group = providers.gradleProperty("pomGroupId").get()
version = providers.gradleProperty("versionName").get()

kotlin {
jvm()
androidLibrary {
android {
namespace = "ru.kode.reactivetasks"
compileSdk = libs.versions.android.compileSdk.get().toInt()
minSdk = libs.versions.android.minSdk.get().toInt()

// withJava() // enable java compilation support
withHostTest {}

withHostTestBuilder {}.configure {}
// withDeviceTestBuilder {
// sourceSetTreeName = "test"
// }

compilations.configureEach {
compilerOptions.configure {
jvmTarget.set(
JvmTarget.JVM_17
)
}
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
// linuxX64()

sourceSets {
commonMain.dependencies {
Expand All @@ -44,40 +33,57 @@ kotlin {

commonTest.dependencies {
implementation(libs.kotlin.test)
implementation(libs.kotlin.coroutines.test)
}

iosMain.dependencies {
implementation(libs.kotlinx.atomicfu)
}
}
}

mavenPublishing {
publishToMavenCentral()
coordinates(artifactId = "reactive-tasks")

publishToMavenCentral()
signAllPublications()

coordinates(group.toString(), "library", version.toString())

pom {
name = "My library"
description = "A library."
inceptionYear = "2024"
url = "https://github.com/appkode/my-library"
val pomName: String by project
val pomDescription: String by project
val pomUrl: String by project
val pomScmUrl: String by project
val pomScmConnection: String by project
val pomScmDevConnection: String by project
val pomLicenseName: String by project
val pomLicenseUrl: String by project
val pomLicenseDist: String by project
val pomDeveloperId: String by project
val pomDeveloperName: String by project

name.set(pomName)
description.set(pomDescription)
url.set(pomUrl)

scm {
url.set(pomScmUrl)
connection.set(pomScmConnection)
developerConnection.set(pomScmDevConnection)
}

licenses {
license {
name = "XXX"
url = "YYY"
distribution = "ZZZ"
name.set(pomLicenseName)
url.set(pomLicenseUrl)
distribution.set(pomLicenseDist)
}
}

developers {
developer {
id = "XXX"
name = "YYY"
url = "ZZZ"
id.set(pomDeveloperId)
name.set(pomDeveloperName)
}
}
scm {
url = "XXX"
connection = "YYY"
developerConnection = "ZZZ"
}
}
}
Loading
Loading