Compare commits

...

4 Commits

Author SHA1 Message Date
27b335a0af fix workflow
All checks were successful
/ publish (push) Successful in 48s
2025-12-13 01:31:56 +01:00
21ed1c40b5 refactor build.gradle.kts 2025-12-13 01:04:46 +01:00
d0c130cb61 use common plugin 2025-12-13 00:49:46 +01:00
1fbff53dbd refactor 2025-12-12 21:59:18 +01:00
5 changed files with 26 additions and 42 deletions

View File

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

View File

@@ -1,55 +1,36 @@
import com.infendro.plugin.infendro
import com.infendro.plugin.token
group = "com.infendro"
version = "1.1.0"
repositories {
maven("https://git.infendro.com/api/packages/Infendro/maven")
mavenCentral()
}
plugins {
alias(libs.plugins.infendro)
alias(libs.plugins.kotlin)
id("maven-publish")
}
repositories {
infendro()
mavenCentral()
}
dependencies {
implementation(libs.migration)
implementation(libs.ktor.server)
implementation(libs.exposed)
implementation(libs.migration)
}
publishing {
publications {
create<MavenPublication>("JVM") {
from(components["java"])
groupId = group as String
groupId = project.group as String
artifactId = project.name
version = version
version = project.version as String
}
}
repositories {
maven {
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"
infendro(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,14 +1,15 @@
[versions]
infendro = "1.0.0"
kotlin = "2.2.10"
ktor = "3.2.3"
exposed = "0.61.0"
migration = "1.1.0"
migration = "1.1.1"
[plugins]
infendro = { id = "com.infendro.plugin", version.ref = "infendro" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
[libraries]
ktor-server = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" }
exposed = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }
migration = { module = "com.infendro:migration", version.ref = "migration" }
ktor-server = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" }
exposed = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }

View File

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

View File

@@ -1,11 +1,9 @@
package com.infendro.ktor.migration
import com.infendro.migration.Config
import com.infendro.migration.migrate
import io.ktor.server.application.*
import org.jetbrains.exposed.sql.Transaction
@Suppress("UNUSED")
val Migration = createApplicationPlugin(
name = "Migration",
createConfiguration = { MigrationConfig() },
@@ -14,9 +12,8 @@ val Migration = createApplicationPlugin(
}
class MigrationConfig {
internal val config = Config()
internal val config = com.infendro.migration.MigrationConfig()
@Suppress("UNUSED")
fun migration(
name: String,
migrate: Transaction.() -> Unit,