-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
140 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Check | ||
|
||
on: | ||
workflow_dispatch: {} | ||
pull_request: {} | ||
push: | ||
branches: [ main ] | ||
tags: [ 'v*' ] | ||
|
||
concurrency: | ||
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
gradle: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version-file: .github/workflows/.ci-java-version | ||
|
||
- uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
arguments: check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
concurrency: | ||
group: "release" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
gradle: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: zulu | ||
java-version-file: .github/workflows/.ci-java-version | ||
|
||
- uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
- name: Publish artifacts | ||
run: ./gradlew :publishAllPublicationsToSonatypeRepository :closeSonatypeStagingRepository --no-parallel | ||
env: | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{secrets.SIGNING_KEY_ID}} | ||
ORG_GRADLE_PROJECT_signingKey: ${{secrets.SIGNING_KEY}} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{secrets.SIGNING_PASSWORD}} | ||
ORG_GRADLE_PROJECT_sonatypeUsername: ${{secrets.SONATYPE_USERNAME}} | ||
ORG_GRADLE_PROJECT_sonatypePassword: ${{secrets.SONATYPE_PASSWORD}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
plugins { | ||
alias(libs.plugins.nexus.publish) // must be applied in the root project | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") | ||
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,18 @@ plugins { | |
alias(libs.plugins.kotlin.serialization) | ||
alias(libs.plugins.kotlinx.binaryCompatibilityValidator) | ||
`maven-publish` | ||
signing | ||
alias(libs.plugins.dokka) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
val publishVersion = project.layout.projectDirectory.file("../version.txt").asFile.readText().trim() | ||
|
||
group = "me.alllex.telegram.botkit" | ||
version = "0.3.0-SNAPSHOT" | ||
version = publishVersion | ||
|
||
java.toolchain.languageVersion = libs.versions.jvmToolchain.map { JavaLanguageVersion.of(it) } | ||
|
||
|
@@ -89,11 +93,65 @@ val sourcesJar by tasks.registering(Jar::class) { | |
from(sourceSets.main.map { it.allSource }) | ||
} | ||
|
||
val javadocJar by tasks.registering(Jar::class) { | ||
description = "Produce javadoc with Dokka HTML inside" | ||
dependsOn(tasks.dokkaHtml) | ||
from(tasks.dokkaHtml) | ||
archiveClassifier = "javadoc" | ||
} | ||
|
||
publishing { | ||
publications { | ||
register("mavenJava", MavenPublication::class) { | ||
artifactId = "tbot-api-jvm" | ||
from(components["java"]) | ||
artifact(sourcesJar.get()) | ||
artifact(sourcesJar) | ||
artifact(javadocJar) | ||
} | ||
} | ||
} | ||
|
||
// Gradle hasn't updated the signing plugin to be compatible with lazy-configuration, so it needs weird workarounds: | ||
afterEvaluate { | ||
// Register signatures in afterEvaluate, otherwise the signing plugin creates the signing tasks | ||
// too early, before all the publications are added. | ||
signing { | ||
val signingKeyId: String? by project | ||
val signingKey: String? by project | ||
val signingPassword: String? by project | ||
|
||
if (signingKeyId != null) { | ||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
sign(publishing.publications) | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications.withType<MavenPublication>().configureEach { | ||
pom { | ||
name = "Telegram BotKit" | ||
description = "Fluent Kotlin bindings for Telegram Bot API" | ||
url = "https://github.com/alllex/telegram-bot-kit" | ||
licenses { | ||
license { | ||
name = "MIT" | ||
url = "https://opensource.org/licenses/MIT" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "alllex" | ||
name = "Alex by Software" | ||
email = "[email protected]" | ||
url = "https://alllex.me" | ||
} | ||
} | ||
scm { | ||
connection = "scm:git:[email protected]:alllex/telegram-bot-kit.git" | ||
developerConnection = "scm:git:[email protected]:alllex/telegram-bot-kit.git" | ||
url = "https://github.com/alllex/telegram-bot-kit" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.3.1-SNAPSHOT |