Compare commits

...

4 Commits

Author SHA1 Message Date
dd5a3d70c3 update README 2025-12-13 23:04:44 +01:00
d5f6c2dac8 fix workflow 2025-12-13 01:32:27 +01:00
be32a97347 refactor build.gradle.kts 2025-12-13 01:03:58 +01:00
1811c98073 use common plugin 2025-12-13 00:49:24 +01:00
5 changed files with 22 additions and 40 deletions

View File

@@ -4,7 +4,7 @@ on:
- main - main
env: env:
GIT__TOKEN: ${{ secrets.TOKEN }} INFENDRO__TOKEN: ${{ secrets.TOKEN }}
jobs: jobs:
publish: publish:

View File

@@ -1,12 +1,6 @@
# Kotlin Database Migration # migration-kt
This library enables code-based database migrations in Kotlin. `migration-kt` is a Kotlin library that enables code-based migrations.
## Features
* Declare database migrations (identified by a unique name).
* Migrations are executed in the order they are declared in.
* Executed migrations are tracked in a database table and skipped on subsequent runs.
## Installation ## Installation
@@ -18,7 +12,7 @@ repositories {
} }
dependencies { dependencies {
implementation("com.infendro:migration:1.1.0") implementation("com.infendro:migration:1.1.1")
} }
``` ```

View File

@@ -1,15 +1,19 @@
import com.infendro.plugin.infendro
import com.infendro.plugin.token
group = "com.infendro" group = "com.infendro"
version = "1.1.1" version = "1.1.1"
repositories {
mavenCentral()
}
plugins { plugins {
alias(libs.plugins.infendro)
alias(libs.plugins.kotlin) alias(libs.plugins.kotlin)
id("maven-publish") id("maven-publish")
} }
repositories {
mavenCentral()
}
dependencies { dependencies {
implementation(libs.exposed) implementation(libs.exposed)
implementation(libs.exposed.dao) implementation(libs.exposed.dao)
@@ -19,35 +23,12 @@ publishing {
publications { publications {
create<MavenPublication>("JVM") { create<MavenPublication>("JVM") {
from(components["java"]) from(components["java"])
groupId = group as String groupId = project.group as String
artifactId = project.name artifactId = project.name
version = version version = project.version as String
} }
} }
repositories { repositories {
maven { infendro(token)
url = uri("https://git.infendro.com/api/packages/Infendro/maven")
authentication.create("header", HttpHeaderAuthentication::class)
credentials(HttpHeaderCredentials::class) {
val token = secret("git.token") ?: throw GradleException()
name = "Authorization"
value = "token $token"
}
}
} }
} }
fun secret(
key: String,
): String? {
val property = key
val environment = key
.uppercase()
.replace(".", "__")
val prop = properties[property] as String?
val env = System.getenv(environment)
return prop ?: env
}

View File

@@ -1,8 +1,10 @@
[versions] [versions]
infendro = "1.0.0"
kotlin = "2.2.10" kotlin = "2.2.10"
exposed = "0.61.0" exposed = "0.61.0"
[plugins] [plugins]
infendro = { id = "com.infendro.plugin", version.ref = "infendro" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
[libraries] [libraries]

View File

@@ -1 +1,6 @@
rootProject.name = "migration" rootProject.name = "migration"
pluginManagement.repositories {
maven("https://git.infendro.com/api/packages/Infendro/maven")
mavenCentral()
}