diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 8a3dce8..8d773be 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -1,4 +1,4 @@ -name: CI +name: Publish a release on: push: diff --git a/.github/workflows/publish_snapshot.yml b/.github/workflows/publish_snapshot.yml index 9e12a75..ae86752 100644 --- a/.github/workflows/publish_snapshot.yml +++ b/.github/workflows/publish_snapshot.yml @@ -1,4 +1,4 @@ -name: CI +name: Publish snapshot on: push: @@ -7,37 +7,40 @@ on: branches: [ master ] jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Test - run: ./gradlew jvmTest - - - name: Archive lib Test Reports - uses: actions/upload-artifact@v1 - with: - name: lib_test_reports - path: lib/build/reports/tests - - - name: Archive lib-threadsafe Test Reports - uses: actions/upload-artifact@v1 - with: - name: lib_test_reports - path: lib/build/reports/tests - publish-snapshot: - needs: test runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [macos-latest, windows-latest, ubuntu-latest] steps: - uses: actions/checkout@v2 - - name: Publish Snapshot + - name: Publish macOS artifacts Snapshot + id: publish-macos + if: matrix.os == 'macos-latest' + env: + SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + GPG_SECRET: ${{ secrets.GPG_SECRET }} + GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }} + SNAPSHOT: 'TRUE' + run: ./gradlew publish + + - name: Publish windows artifacts Snapshot + id: publish-win + if: matrix.os == 'windows-latest' + env: + SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + GPG_SECRET: ${{ secrets.GPG_SECRET }} + GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }} + SNAPSHOT: 'TRUE' + run: ./gradlew publish + + - name: Publish linux artifacts Snapshot + id: publish-linux + if: matrix.os == 'ubuntu-latest' env: SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} @@ -45,3 +48,17 @@ jobs: GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }} SNAPSHOT: 'TRUE' run: ./gradlew publish + + - name: Archive lib publications dir + uses: actions/upload-artifact@v1 + with: + name: publications-${{ matrix.os }} + path: redux-kotlin/build/publications + + - name: Archive lib-threadsafe publications dir + if: steps.publish-win.outputs.exit_code == 0 || steps.publish-macos.outputs.exit_code == 0 || steps.publish-linux.outputs.exit_code == 0 + uses: actions/upload-artifact@v1 + with: + name: publications-threadsafe-${{ matrix.os }} + path: redux-kotlin-threadsafe/build/publications + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..96b23f1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Test + run: ./gradlew jvmTest + + - name: Archive redux-kotlin Test Reports + uses: actions/upload-artifact@v1 + with: + name: redux-kotlin_test_reports + path: redux-kotlin/build/reports/tests + + - name: Archive redux-kotlin-threadsafe Test Reports + uses: actions/upload-artifact@v1 + with: + name: redux-kotlin-threadsafe_test_reports + path: redux-kotlin-threadsafe/build/reports/tests diff --git a/examples/counter/android/build.gradle.kts b/examples/counter/android/build.gradle.kts index e5bd61f..39ab5d9 100644 --- a/examples/counter/android/build.gradle.kts +++ b/examples/counter/android/build.gradle.kts @@ -40,5 +40,5 @@ dependencies { implementation(Libs.appcompat) implementation(project(":examples:counter:common")) - implementation(project(":lib-threadsafe")) + implementation(project(":redux-kotlin-threadsafe")) } diff --git a/examples/counter/common/build.gradle b/examples/counter/common/build.gradle index a233cb8..35468b1 100644 --- a/examples/counter/common/build.gradle +++ b/examples/counter/common/build.gradle @@ -32,7 +32,7 @@ kotlin { commonMain { dependencies { implementation kotlin("stdlib-common") - implementation project(":lib") + implementation project(":redux-kotlin") } } commonTest { diff --git a/examples/todos/android/build.gradle.kts b/examples/todos/android/build.gradle.kts index 76dd226..2a2de10 100644 --- a/examples/todos/android/build.gradle.kts +++ b/examples/todos/android/build.gradle.kts @@ -43,5 +43,5 @@ dependencies { implementation(Libs.recyclerView) implementation(project(":examples:todos:common")) - implementation(project(":lib-threadsafe")) + implementation(project(":redux-kotlin-threadsafe")) } diff --git a/examples/todos/common/build.gradle b/examples/todos/common/build.gradle index ac8e1eb..4e84145 100644 --- a/examples/todos/common/build.gradle +++ b/examples/todos/common/build.gradle @@ -32,7 +32,7 @@ kotlin { commonMain { dependencies { implementation kotlin("stdlib-common") - implementation project(":lib-threadsafe") + implementation project(":redux-kotlin-threadsafe") } } commonTest { diff --git a/gradle.properties b/gradle.properties index 574ebd1..3727253 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,8 +20,8 @@ android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official -GROUP=org.reduxkotlin.redux-kotlin -VERSION_NAME=0.5.2 +GROUP=org.reduxkotlin +VERSION_NAME=0.5.3 POM_ARTIFACT_ID=reduxkotlin POM_DESCRIPTION=Redux implementation for Kotlin. Mulitiplatform supported. diff --git a/lib-threadsafe/build.gradle b/redux-kotlin-threadsafe/build.gradle similarity index 95% rename from lib-threadsafe/build.gradle rename to redux-kotlin-threadsafe/build.gradle index 0b4323f..91faaae 100644 --- a/lib-threadsafe/build.gradle +++ b/redux-kotlin-threadsafe/build.gradle @@ -35,7 +35,7 @@ kotlin { commonMain { dependencies { implementation kotlin("stdlib-common") - api project(":lib") + api project(":redux-kotlin") } } commonTest { @@ -118,6 +118,12 @@ afterEvaluate { apply from: rootProject.file('gradle/publish.gradle') +publishing { + publications.all { + artifactId = artifactId.replace(project.name, 'redux-kotlin-threadsafe') + } +} + jvmTest { useJUnitPlatform { includeEngines 'spek2' diff --git a/lib-threadsafe/src/commonMain/kotlin/org/reduxkotlin/CreateThreadSafeStore.kt b/redux-kotlin-threadsafe/src/commonMain/kotlin/org/reduxkotlin/CreateThreadSafeStore.kt similarity index 100% rename from lib-threadsafe/src/commonMain/kotlin/org/reduxkotlin/CreateThreadSafeStore.kt rename to redux-kotlin-threadsafe/src/commonMain/kotlin/org/reduxkotlin/CreateThreadSafeStore.kt diff --git a/lib-threadsafe/src/commonMain/kotlin/org/reduxkotlin/SynchronizedStore.kt b/redux-kotlin-threadsafe/src/commonMain/kotlin/org/reduxkotlin/SynchronizedStore.kt similarity index 100% rename from lib-threadsafe/src/commonMain/kotlin/org/reduxkotlin/SynchronizedStore.kt rename to redux-kotlin-threadsafe/src/commonMain/kotlin/org/reduxkotlin/SynchronizedStore.kt diff --git a/lib-threadsafe/src/jvmTest/kotlin/org/reduxkotlin/util/CreateThreadSafeStoreSpec.kt b/redux-kotlin-threadsafe/src/jvmTest/kotlin/org/reduxkotlin/util/CreateThreadSafeStoreSpec.kt similarity index 100% rename from lib-threadsafe/src/jvmTest/kotlin/org/reduxkotlin/util/CreateThreadSafeStoreSpec.kt rename to redux-kotlin-threadsafe/src/jvmTest/kotlin/org/reduxkotlin/util/CreateThreadSafeStoreSpec.kt diff --git a/lib/.gitignore b/redux-kotlin/.gitignore similarity index 100% rename from lib/.gitignore rename to redux-kotlin/.gitignore diff --git a/lib/build.gradle b/redux-kotlin/build.gradle similarity index 97% rename from lib/build.gradle rename to redux-kotlin/build.gradle index ba01e96..7b9a7b0 100644 --- a/lib/build.gradle +++ b/redux-kotlin/build.gradle @@ -133,6 +133,12 @@ afterEvaluate { apply from: rootProject.file('gradle/publish.gradle') +publishing { + publications.all { + artifactId = artifactId.replace(project.name, 'redux-kotlin') + } +} + jvmTest { useJUnitPlatform { includeEngines 'spek2' diff --git a/lib/proguard-rules.pro b/redux-kotlin/proguard-rules.pro similarity index 100% rename from lib/proguard-rules.pro rename to redux-kotlin/proguard-rules.pro diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/Action.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/Action.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/Action.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/Action.kt diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/ApplyMiddleware.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/ApplyMiddleware.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/ApplyMiddleware.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/ApplyMiddleware.kt diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/CombineReducers.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/CombineReducers.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/CombineReducers.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/CombineReducers.kt diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/Compose.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/Compose.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/Compose.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/Compose.kt diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/CreateSameThreadEnforcedStore.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/CreateSameThreadEnforcedStore.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/CreateSameThreadEnforcedStore.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/CreateSameThreadEnforcedStore.kt diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/CreateStore.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/CreateStore.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/CreateStore.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/CreateStore.kt diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/Definitions.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/Definitions.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/Definitions.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/Definitions.kt diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/utils/IsPlainObject.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/utils/IsPlainObject.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/utils/IsPlainObject.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/utils/IsPlainObject.kt diff --git a/lib/src/commonMain/kotlin/org/reduxkotlin/utils/ThreadUtil.kt b/redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/utils/ThreadUtil.kt similarity index 100% rename from lib/src/commonMain/kotlin/org/reduxkotlin/utils/ThreadUtil.kt rename to redux-kotlin/src/commonMain/kotlin/org/reduxkotlin/utils/ThreadUtil.kt diff --git a/lib/src/fallbackMain/kotlin/org/reduxkotlin/utils/ThreadUtilFallback.kt b/redux-kotlin/src/fallbackMain/kotlin/org/reduxkotlin/utils/ThreadUtilFallback.kt similarity index 100% rename from lib/src/fallbackMain/kotlin/org/reduxkotlin/utils/ThreadUtilFallback.kt rename to redux-kotlin/src/fallbackMain/kotlin/org/reduxkotlin/utils/ThreadUtilFallback.kt diff --git a/lib/src/iosMain/kotlin/org/reduxkotlin/utils/ThreadUtiliOS.kt b/redux-kotlin/src/iosMain/kotlin/org/reduxkotlin/utils/ThreadUtiliOS.kt similarity index 100% rename from lib/src/iosMain/kotlin/org/reduxkotlin/utils/ThreadUtiliOS.kt rename to redux-kotlin/src/iosMain/kotlin/org/reduxkotlin/utils/ThreadUtiliOS.kt diff --git a/lib/src/jsMain/kotlin/org/reduxkotlin/utils/ThreadUtil.kt b/redux-kotlin/src/jsMain/kotlin/org/reduxkotlin/utils/ThreadUtil.kt similarity index 100% rename from lib/src/jsMain/kotlin/org/reduxkotlin/utils/ThreadUtil.kt rename to redux-kotlin/src/jsMain/kotlin/org/reduxkotlin/utils/ThreadUtil.kt diff --git a/lib/src/jvmMain/kotlin/org/reduxkotlin/utils/ThreadUtilJvm.kt b/redux-kotlin/src/jvmMain/kotlin/org/reduxkotlin/utils/ThreadUtilJvm.kt similarity index 100% rename from lib/src/jvmMain/kotlin/org/reduxkotlin/utils/ThreadUtilJvm.kt rename to redux-kotlin/src/jvmMain/kotlin/org/reduxkotlin/utils/ThreadUtilJvm.kt diff --git a/lib/src/jvmTest/kotlin/org/reduxkotlin/util/CreateSameThreadEnforcedStoreSpec.kt b/redux-kotlin/src/jvmTest/kotlin/org/reduxkotlin/util/CreateSameThreadEnforcedStoreSpec.kt similarity index 100% rename from lib/src/jvmTest/kotlin/org/reduxkotlin/util/CreateSameThreadEnforcedStoreSpec.kt rename to redux-kotlin/src/jvmTest/kotlin/org/reduxkotlin/util/CreateSameThreadEnforcedStoreSpec.kt diff --git a/lib/src/macosMain/kotlin/org/reduxkotlin/utils/ThreadUtilMacOs.kt b/redux-kotlin/src/macosMain/kotlin/org/reduxkotlin/utils/ThreadUtilMacOs.kt similarity index 100% rename from lib/src/macosMain/kotlin/org/reduxkotlin/utils/ThreadUtilMacOs.kt rename to redux-kotlin/src/macosMain/kotlin/org/reduxkotlin/utils/ThreadUtilMacOs.kt diff --git a/lib/src/test/kotlin/org/reduxkotlin/ApplyMiddlewareTest.kt b/redux-kotlin/src/test/kotlin/org/reduxkotlin/ApplyMiddlewareTest.kt similarity index 100% rename from lib/src/test/kotlin/org/reduxkotlin/ApplyMiddlewareTest.kt rename to redux-kotlin/src/test/kotlin/org/reduxkotlin/ApplyMiddlewareTest.kt diff --git a/lib/src/test/kotlin/org/reduxkotlin/CreateStoreSpec.kt b/redux-kotlin/src/test/kotlin/org/reduxkotlin/CreateStoreSpec.kt similarity index 100% rename from lib/src/test/kotlin/org/reduxkotlin/CreateStoreSpec.kt rename to redux-kotlin/src/test/kotlin/org/reduxkotlin/CreateStoreSpec.kt diff --git a/settings.gradle b/settings.gradle index b960d02..e37467e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,8 +9,8 @@ pluginManagement { } include( - ':lib', - ':lib-threadsafe', + ':redux-kotlin', + ':redux-kotlin-threadsafe', ':examples:counter:common', ':examples:counter:android', ':examples:todos:common',