Skip to content

Commit

Permalink
Migrate CI to Teamcity
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Mar 1, 2024
1 parent 150d7a4 commit f5c7768
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 149 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/deployment-ci.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/documentation-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Documentation CI
on:
push:
pull_request:

permissions:
id-token: write
pages: write

jobs:
docs:
uses: kordlib/.teamcity/.github/workflows/documentation.yml@main
97 changes: 34 additions & 63 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import java.util.*

version = Library.version
group = Library.group

plugins {
alias(libs.plugins.kotlin.multiplatform)
signing
`maven-publish`
alias(libs.plugins.kord.gradle.plugin)
alias(libs.plugins.maven.publish.plugin)
dev.kord.x.emoji
}

Expand All @@ -32,7 +29,7 @@ kotlin {

iosArm64()
iosX64()
iosSimulatorArm64()
iosSimulatorArm64()

watchosArm64()
watchosSimulatorArm64()
Expand All @@ -42,73 +39,47 @@ kotlin {
tvosSimulatorArm64()
}

publishing {
publications {
withType<MavenPublication> {
pom {
name = Library.name
description = Library.description
url = Library.description

organization {
name = "Kord"
url = Library.projectUrl
}

developers {
developer {
name = "The Kord Team"
}
}

issueManagement {
system = "GitHub"
url = "${Library.projectUrl}/issues"
}

licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
}
}
scm {
connection = "scm:git:ssh://github.com/kordlib/kordx.emoji.git"
developerConnection = "scm:git:ssh://[email protected]:kordlib/kord.emoji.git"
url = Library.projectUrl
}
mavenPublishing {
coordinates(artifactId = Library.name)
publishToMavenCentral()
signAllPublications()

pom {
name = Library.name
description = Library.description
url = Library.description

organization {
name = "Kord"
url = Library.projectUrl
}

developers {
developer {
name = "The Kord Team"
}
}

repositories {
maven {
url = if (Library.isSnapshot) uri(Repo.snapshotsUrl)
else uri(Repo.releasesUrl)
issueManagement {
system = "GitHub"
url = "${Library.projectUrl}/issues"
}

credentials {
username = System.getenv("NEXUS_USER")
password = System.getenv("NEXUS_PASSWORD")
}
licenses {
license {
name = "MIT"
url = "https://opensource.org/licenses/MIT"
}
}
}
}

signing {
val signingKey = findProperty("signingKey")?.toString()
val signingPassword = findProperty("signingPassword")?.toString()
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(
Base64.getDecoder().decode(signingKey).decodeToString(),
signingPassword
)

publishing.publications.withType<MavenPublication> {
sign(this)
scm {
connection = "scm:git:ssh://github.com/kordlib/kordx.emoji.git"
developerConnection = "scm:git:ssh://[email protected]:kordlib/kord.emoji.git"
url = Library.projectUrl
}
}
}


dependencies {
commonMainImplementation(libs.kord.core) {
exclude(module = "kord-ksp-annotations")
Expand Down
23 changes: 0 additions & 23 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
object Library {
const val name = "emoji"
const val group = "dev.kord.x"
val version: String
get() {
val tag = System.getenv("GITHUB_TAG_NAME")
val branch = System.getenv("GITHUB_BRANCH_NAME")
return when {
!tag.isNullOrBlank() -> tag
!branch.isNullOrBlank() && branch.startsWith("refs/heads/") ->
branch.substringAfter("refs/heads/").replace("/", "-") + "-SNAPSHOT"
else -> "undefined"
}
}
val isSnapshot: Boolean get() = version.endsWith("-SNAPSHOT")
const val description = "Discord Emoji constants for Kord"
const val projectUrl = "https://github.com/kordlib/kordx.emoji"
/**
* Whether the current API is considered stable, and should be compared to the 'golden' API dump.
*/
val isRelease: Boolean get() = !isSnapshot && !isUndefined

val isUndefined get() = version == "undefined"
}

object Repo {
const val releasesUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
const val snapshotsUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ kord-core = { group = "dev.kord", name = "kord-core", version = "feature-native-
[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kord-gradle-plugin = { id = "dev.kord.gradle-tools", version = "1.3.0" }
maven-publish-plugin = { id = "com.vanniktech.maven.publish.base", version = "0.27.0" }
9 changes: 9 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
// Repo providing the Kord Gradle plugin
maven("https://europe-west3-maven.pkg.dev/mik-music/kord")
}
}

rootProject.name = "kordx.emoji"

0 comments on commit f5c7768

Please sign in to comment.