Repository: kevincianfarini/cardiologist
Pull request #10 (2023-12-19 02:54:29)

Add Github publishing action


Patch:
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
new file mode 100644
index 0000000..7728979
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,36 @@
+name: release
+
+on:
+  push:
+    tags:
+      - '**'
+
+env:
+  GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
+
+jobs:
+  publish:
+    runs-on: macos-latest
+
+    steps:
+      - uses: actions/checkout@v4
+      - uses: actions/setup-java@v4.0.0
+        with:
+          distribution: 'zulu'
+          java-version: 19
+
+      - name: Build and publish artifacts
+        env:
+          ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
+          ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
+          ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
+        run: ./gradlew dokkaHtml publish
+
+      - name: Deploy docs to website
+        uses: JamesIves/github-pages-deploy-action@releases/v3
+        with:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          BRANCH: site
+          FOLDER: build/dokka/html
+          TARGET_FOLDER: docs/0.x/
+          CLEAN: true
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 8839445..5ac3ffe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 .idea
 .gradle
-**/build
\ No newline at end of file
+**/build
+local.properties
\ No newline at end of file
diff --git a/README.md b/README.md
index 2231f01..c8b68c4 100644
--- a/README.md
+++ b/README.md
@@ -80,7 +80,7 @@ to beat a pulse which allow jobs to run concurrently or apply backpressure.
 You should not collect a `Flow<Pulse>` without calling `beat`. 
 
 ```kt
-import com.kevincianfarini.cardiologist.RecurringJobMode.*
+import io.github.kevincianfarini.cardiologist.RecurringJobMode.*
 
 // Cancels previous job when next job is scheduled to occur. 
 hourlyPulse.beat(mode = CancellingSequential) { instant -> longRunningOperation(instant) }
diff --git a/build.gradle.kts b/build.gradle.kts
index 98380fc..e57c1e4 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,3 +1,5 @@
+import com.vanniktech.maven.publish.SonatypeHost
+
 plugins {
     alias(libs.plugins.dokka)
     alias(libs.plugins.kotlin.multiplatform)
@@ -28,7 +30,6 @@ kotlin {
 
     sourceSets {
         commonMain.dependencies {
-            api(libs.kotlinx.atomicfu)
             api(libs.kotlinx.coroutines.core)
             api(libs.kotlinx.datetime)
         }
@@ -46,4 +47,9 @@ tasks.withType<AbstractTestTask> {
         showStandardStreams = true
         showStackTraces = true
     }
+}
+
+mavenPublishing {
+    publishToMavenCentral(host = SonatypeHost.S01)
+    signAllPublications()
 }
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index ddf5846..515ffc4 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,6 +1,6 @@
 kotlin.code.style=official
 
-GROUP=com.kevincianfarini.cardiologist
+GROUP=io.github.kevincianfarini.cardiologist
 POM_ARTIFACT_ID=cardiologist
 VERSION_NAME=0.1.0-SNAPSHOT
 
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 9df0b2e..2d31c35 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,15 +1,13 @@
 [versions]
 dokka = "1.9.10"
 kotlin = "1.9.21"
-kotlinx-atomicfu = "0.23.1" # This is a workaround for https://github.com/Kotlin/kotlinx.coroutines/issues/3968
-kotlinx-coroutines = "1.8.0-RC"
+kotlinx-coroutines = "1.8.0-RC2"
 kotlinx-datetime = "0.5.0"
 turbine = "1.0.0"
 publish = "0.25.3"
 
 [libraries]
 kotlin-test-core = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
-kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "kotlinx-atomicfu" }
 kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
 kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
 kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
diff --git a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/Pulse.kt b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/Pulse.kt
similarity index 89%
rename from src/commonMain/kotlin/com/kevincianfarini/cardiologist/Pulse.kt
rename to src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/Pulse.kt
index cc5db17..5ac40a4 100644
--- a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/Pulse.kt
+++ b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/Pulse.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist
+package io.github.kevincianfarini.cardiologist
 
 import kotlinx.datetime.Instant
 
diff --git a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/RecurringJobMode.kt b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/RecurringJobMode.kt
similarity index 92%
rename from src/commonMain/kotlin/com/kevincianfarini/cardiologist/RecurringJobMode.kt
rename to src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/RecurringJobMode.kt
index a9de384..f0bc31f 100644
--- a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/RecurringJobMode.kt
+++ b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/RecurringJobMode.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist
+package io.github.kevincianfarini.cardiologist
 
 public enum class RecurringJobMode {
 
diff --git a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/flow.kt b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/flow.kt
similarity index 97%
rename from src/commonMain/kotlin/com/kevincianfarini/cardiologist/flow.kt
rename to src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/flow.kt
index 70d19e4..79fd300 100644
--- a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/flow.kt
+++ b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/flow.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist
+package io.github.kevincianfarini.cardiologist
 
 import kotlinx.coroutines.CoroutineName
 import kotlinx.coroutines.coroutineScope
@@ -8,7 +8,7 @@ import kotlinx.coroutines.flow.collectLatest
 import kotlinx.coroutines.flow.flow
 import kotlinx.coroutines.launch
 import kotlinx.datetime.*
-import com.kevincianfarini.cardiologist.impl.nextMatch
+import io.github.kevincianfarini.cardiologist.impl.nextMatch
 import kotlin.time.Duration
 
 /**
diff --git a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/impl/LocalDateTime.kt b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/impl/LocalDateTime.kt
similarity index 99%
rename from src/commonMain/kotlin/com/kevincianfarini/cardiologist/impl/LocalDateTime.kt
rename to src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/impl/LocalDateTime.kt
index f35c92a..4134db9 100644
--- a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/impl/LocalDateTime.kt
+++ b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/impl/LocalDateTime.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist.impl
+package io.github.kevincianfarini.cardiologist.impl
 
 import kotlinx.datetime.LocalDateTime
 import kotlinx.datetime.Month
diff --git a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/suspend.kt b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/suspend.kt
similarity index 95%
rename from src/commonMain/kotlin/com/kevincianfarini/cardiologist/suspend.kt
rename to src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/suspend.kt
index b952813..72d3896 100644
--- a/src/commonMain/kotlin/com/kevincianfarini/cardiologist/suspend.kt
+++ b/src/commonMain/kotlin/io/github/kevincianfarini/cardiologist/suspend.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist
+package io.github.kevincianfarini.cardiologist
 
 import kotlinx.coroutines.delay
 import kotlinx.datetime.*


Test patch:
diff --git a/src/commonTest/kotlin/com/kevincianfarini/cardiologist/FakeClock.kt b/src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/FakeClock.kt
similarity index 93%
rename from src/commonTest/kotlin/com/kevincianfarini/cardiologist/FakeClock.kt
rename to src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/FakeClock.kt
index f56ba9f..29f2598 100644
--- a/src/commonTest/kotlin/com/kevincianfarini/cardiologist/FakeClock.kt
+++ b/src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/FakeClock.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist
+package io.github.kevincianfarini.cardiologist
 
 import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.test.TestCoroutineScheduler
diff --git a/src/commonTest/kotlin/com/kevincianfarini/cardiologist/FlowTests.kt b/src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/FlowTests.kt
similarity index 97%
rename from src/commonTest/kotlin/com/kevincianfarini/cardiologist/FlowTests.kt
rename to src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/FlowTests.kt
index 3ec219e..d0049e5 100644
--- a/src/commonTest/kotlin/com/kevincianfarini/cardiologist/FlowTests.kt
+++ b/src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/FlowTests.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist
+package io.github.kevincianfarini.cardiologist
 
 import app.cash.turbine.test
 import kotlinx.coroutines.Dispatchers
diff --git a/src/commonTest/kotlin/com/kevincianfarini/cardiologist/SuspendingTests.kt b/src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/SuspendingTests.kt
similarity index 98%
rename from src/commonTest/kotlin/com/kevincianfarini/cardiologist/SuspendingTests.kt
rename to src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/SuspendingTests.kt
index 4de33ab..519e725 100644
--- a/src/commonTest/kotlin/com/kevincianfarini/cardiologist/SuspendingTests.kt
+++ b/src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/SuspendingTests.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist
+package io.github.kevincianfarini.cardiologist
 
 import kotlinx.coroutines.ExperimentalCoroutinesApi
 import kotlinx.coroutines.test.runTest
diff --git a/src/commonTest/kotlin/com/kevincianfarini/cardiologist/impl/LocalDateTimeTest.kt b/src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/impl/LocalDateTimeTest.kt
similarity index 99%
rename from src/commonTest/kotlin/com/kevincianfarini/cardiologist/impl/LocalDateTimeTest.kt
rename to src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/impl/LocalDateTimeTest.kt
index d8ce0c6..4d42170 100644
--- a/src/commonTest/kotlin/com/kevincianfarini/cardiologist/impl/LocalDateTimeTest.kt
+++ b/src/commonTest/kotlin/io/github/kevincianfarini/cardiologist/impl/LocalDateTimeTest.kt
@@ -1,4 +1,4 @@
-package com.kevincianfarini.cardiologist.impl
+package io.github.kevincianfarini.cardiologist.impl
 
 import kotlinx.datetime.*
 import kotlin.test.Test