Skip to content

Commit

Permalink
Merge pull request #7 from makeevrserg/k2
Browse files Browse the repository at this point in the history
K2
  • Loading branch information
makeevrserg authored May 29, 2024
2 parents 95237e5 + c6a0d9d commit 67b754c
Show file tree
Hide file tree
Showing 17 changed files with 223 additions and 435 deletions.
23 changes: 23 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
rebase-strategy: "disabled"
groups:
versions:
dependency-type: production
applies-to: version-updates
open-pull-requests-limit: 1

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
versions:
dependency-type: production
applies-to: version-updates
rebase-strategy: "disabled"
open-pull-requests-limit: 1
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ jobs:
name: "Check project by detekt"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.17
uses: actions/setup-java@v2
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Give gradle permission
run: chmod +x gradlew
- name: detekt
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
arguments: detekt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
name: "Gradle Wrapper Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v3
38 changes: 38 additions & 0 deletions .github/workflows/call-publish-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "tests"
on:
workflow_call:
secrets:
SIGNING_KEY_ID:
required: true
SIGNING_PASSWORD:
required: true
OSSRH_USERNAME:
required: true
OSSRH_PASSWORD:
required: true
SIGNING_KEY:
required: true

jobs:
tests:
name: "Run tests"
runs-on: ubuntu-latest
env:
makeevrserg_SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
makeevrserg_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
makeevrserg_OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
makeevrserg_OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
makeevrserg_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 1.17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Give gradle permission
run: chmod +x gradlew
- name: Run publish
uses: gradle/gradle-build-action@v3
with:
arguments: publishToMavenLocal
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ jobs:
name: "Run tests"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 1.17
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Give gradle permission
run: chmod +x gradlew
- name: Run tests
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
arguments: test
arguments: allTests
28 changes: 25 additions & 3 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,34 @@ on:
- master
- develop

# Concurrency strategy:
# github.workflow: distinguish this workflow from others
# github.event_name: distinguish `push` event from `pull_request` event
# github.ref_name: distinguish branch
# github.repository: distinguish owner+repository
#
# Reference:
# https://docs.github.com/en/actions/using-jobs/using-concurrency
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{github.ref_name}}-${{github.repository}}
cancel-in-progress: true

jobs:
gradle_validation:
uses: ./.github/workflows/gradle-wrapper-validation.yml
uses: ./.github/workflows/call-gradle-wrapper-validation.yml
detekt_validation:
needs: gradle_validation
uses: ./.github/workflows/detekt-validation.yml
uses: ./.github/workflows/call-detekt-validation.yml
tests_validation:
needs: gradle_validation
uses: ./.github/workflows/tests-validation.yml
uses: ./.github/workflows/call-tests-validation.yml
publsih_validation:
needs: gradle_validation
uses: ./.github/workflows/call-publish-validation.yml
secrets:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
31 changes: 13 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,25 @@ on:

jobs:
gradle_validation:
uses: ./.github/workflows/gradle-wrapper-validation.yml
detekt_validation:
needs: gradle_validation
uses: ./.github/workflows/detekt-validation.yml
tests_validation:
needs: gradle_validation
uses: ./.github/workflows/tests-validation.yml
uses: ./.github/workflows/call-gradle-wrapper-validation.yml
publish:
name: Publish library at mavenCentral
runs-on: macOS-latest
needs: [ gradle_validation, detekt_validation, tests_validation ]
needs: [ gradle_validation ]
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
makeevrserg_SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
makeevrserg_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
makeevrserg_OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
makeevrserg_OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
makeevrserg_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
java-version: '17'
- name: Give gradle permission
run: chmod +x gradlew
- name: Prebuild library
Expand All @@ -42,15 +37,15 @@ jobs:
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: christian-draeger/[email protected]
id: properties
with:
path: './gradle.properties'
properties: 'makeevrserg.project.name makeevrserg.project.version.string'
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.gradle
.idea
.kotlin
build
mikro-core/build
mikro-platform/build
mikro-locale/build
local.properties
local.properties
kotlin-js-store/*
37 changes: 23 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,35 @@
buildscript {
dependencies {
classpath(libs.makeevrserg.gradleplugin.convention)
classpath(libs.makeevrserg.gradleplugin.android)
}
}
plugins {
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.gradle.android) apply false
// klibs - core
alias(libs.plugins.klibs.gradle.detekt) apply false
alias(libs.plugins.klibs.gradle.detekt.compose) apply false
alias(libs.plugins.klibs.gradle.dokka.root) apply false
alias(libs.plugins.klibs.gradle.dokka.module) apply false
alias(libs.plugins.klibs.gradle.java.core) apply false
alias(libs.plugins.klibs.gradle.stub.javadoc) apply false
alias(libs.plugins.klibs.gradle.publication) apply false
alias(libs.plugins.klibs.gradle.rootinfo) apply false
// klibs - android
alias(libs.plugins.klibs.gradle.android.core) apply false
alias(libs.plugins.klibs.gradle.android.compose) apply false
alias(libs.plugins.klibs.gradle.android.apk.sign) apply false
alias(libs.plugins.klibs.gradle.android.apk.name) apply false
alias(libs.plugins.klibs.gradle.android.publication) apply false
}

apply(plugin = "ru.astrainteractive.gradleplugin.dokka.root")
apply(plugin = "ru.astrainteractive.gradleplugin.detekt")
apply(plugin = "ru.astrainteractive.gradleplugin.root.info")

subprojects.forEach {
it.apply(plugin = "ru.astrainteractive.gradleplugin.dokka.module")
it.apply(plugin = "ru.astrainteractive.gradleplugin.publication")
it.plugins.withId("org.jetbrains.kotlin.jvm") {
it.apply(plugin = "ru.astrainteractive.gradleplugin.java.core")
subprojects.forEach { subProject ->
subProject.apply(plugin = "ru.astrainteractive.gradleplugin.dokka.module")
subProject.apply(plugin = "ru.astrainteractive.gradleplugin.publication")
subProject.plugins.withId("org.jetbrains.kotlin.jvm") {
subProject.apply(plugin = "ru.astrainteractive.gradleplugin.java.core")
}
it.apply(plugin = "ru.astrainteractive.gradleplugin.stub.javadoc")
it.plugins.withId("com.android.library") {
it.apply(plugin = "ru.astrainteractive.gradleplugin.android.core")
subProject.apply(plugin = "ru.astrainteractive.gradleplugin.stub.javadoc")
subProject.plugins.withId("com.android.library") {
subProject.apply(plugin = "ru.astrainteractive.gradleplugin.android.core")
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ makeevrserg.java.ktarget=17
# Project
makeevrserg.project.name=MiKro
makeevrserg.project.group=ru.astrainteractive.klibs
makeevrserg.project.version.string=1.7.0
makeevrserg.project.version.string=1.8.0
makeevrserg.project.description=Kotlin Multiplatform library with useful code
makeevrserg.project.developers=makeevrserg|Makeev Roman|[email protected]
makeevrserg.project.url=https://github.com/makeevrserg/kstorage
Expand Down
26 changes: 21 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[versions]
# Kotlin
kotlin-version = "1.9.23" # # https://github.com/JetBrains/kotlin
kotlin-coroutines-core = "1.8.0" # https://github.com/Kotlin/kotlinx.coroutines
makeevrserg-gradleplugin = "0.5.1" # https://github.com/makeevrserg/gradle-plugin
gradle-android = "7.4.2" # https://developer.android.com/build#top-level
kotlin-version = "2.0.0" # # https://github.com/JetBrains/kotlin
kotlin-coroutines-core = "1.8.1" # https://github.com/Kotlin/kotlinx.coroutines
makeevrserg-gradleplugin = "1.1.2" # https://github.com/makeevrserg/gradle-plugin
gradle-android = "8.4.1" # https://developer.android.com/build#top-level
decompose = "3.0.0" # https://github.com/arkivanov/Decompose
kotlinx-datetime = "0.5.0" # https://github.com/Kotlin/kotlinx-datetime
kotlinx-datetime = "0.6.0" # https://github.com/Kotlin/kotlinx-datetime
moko-resources = "0.23.0" # https://github.com/icerockdev/moko-resources
klibs-gradleplugin = "1.1.1" # https://github.com/makeevrserg/gradle-plugin
[libraries]
kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines-core" }
makeevrserg-gradleplugin-convention = { module = "ru.astrainteractive.gradleplugin:convention", version.ref = "makeevrserg-gradleplugin" }
Expand All @@ -17,3 +18,18 @@ moko-resources = { module = "dev.icerock.moko:resources", version.ref = "moko-re
[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-version" }
gradle-android = { id = "com.android.library", version.ref = "gradle-android" }
# klibs - core
klibs-gradle-detekt = { id = "ru.astrainteractive.gradleplugin.detekt", version.ref = "klibs-gradleplugin" }
klibs-gradle-detekt-compose = { id = "ru.astrainteractive.gradleplugin.detekt.compose", version.ref = "klibs-gradleplugin" }
klibs-gradle-dokka-root = { id = "ru.astrainteractive.gradleplugin.dokka.root", version.ref = "klibs-gradleplugin" }
klibs-gradle-dokka-module = { id = "ru.astrainteractive.gradleplugin.dokka.module", version.ref = "klibs-gradleplugin" }
klibs-gradle-java-core = { id = "ru.astrainteractive.gradleplugin.java.core", version.ref = "klibs-gradleplugin" }
klibs-gradle-stub-javadoc = { id = "ru.astrainteractive.gradleplugin.stub.javadoc", version.ref = "klibs-gradleplugin" }
klibs-gradle-publication = { id = "ru.astrainteractive.gradleplugin.publication", version.ref = "klibs-gradleplugin" }
klibs-gradle-rootinfo = { id = "ru.astrainteractive.gradleplugin.root.info", version.ref = "klibs-gradleplugin" }
# klibs - android
klibs-gradle-android-core = { id = "ru.astrainteractive.gradleplugin.android.core", version.ref = "klibs-gradleplugin" }
klibs-gradle-android-compose = { id = "ru.astrainteractive.gradleplugin.android.compose", version.ref = "klibs-gradleplugin" }
klibs-gradle-android-apk-sign = { id = "ru.astrainteractive.gradleplugin.android.apk.sign", version.ref = "klibs-gradleplugin" }
klibs-gradle-android-apk-name = { id = "ru.astrainteractive.gradleplugin.android.apk.name", version.ref = "klibs-gradleplugin" }
klibs-gradle-android-publication = { id = "ru.astrainteractive.gradleplugin.android.publication", version.ref = "klibs-gradleplugin" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 67b754c

Please sign in to comment.