diff --git a/README.md b/README.md index 12cc83d653e..29a87316f0b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Kord [![Discord](https://img.shields.io/discord/556525343595298817.svg?color=&label=Kord&logo=discord&style=for-the-badge)](https://discord.gg/6jcx5ev) -[![Download](https://img.shields.io/maven-central/v/dev.kord/kord-core.svg?label=Maven%20Central&style=for-the-badge)](https://central.sonatype.com/artifact/dev.kord/kord-core) +[![Download](https://img.shields.io/maven-central/v/computer.kolektiv.kord/kord-core.svg?label=Maven%20Central&style=for-the-badge)](https://central.sonatype.com/artifact/computer.kolektiv.kord/kord-core) [![Github CI status (branch)](https://img.shields.io/github/actions/workflow/status/kordlib/kord/deployment-ci.yml?branch=main&label=CI&style=for-the-badge)]() Kord is a [coroutine-based](https://kotlinlang.org/docs/reference/coroutines-overview.html), modularized implementation @@ -61,7 +61,7 @@ e.g: `feature-amazing-thing-SNAPSHOT` for the branch `feature/amazing-thing` For Snapshots for the branch `main` replace `{version}` with `{nextPlannedVersion}-SNAPSHOT` (see `nextPlannedVersion` in [`gradle.properties`](gradle.properties)) -[![Download](https://img.shields.io/maven-central/v/dev.kord/kord-core.svg?label=Maven%20Central&style=for-the-badge)](https://central.sonatype.com/artifact/dev.kord/kord-core) +[![Download](https://img.shields.io/maven-central/v/computer.kolektiv.kord/kord-core.svg?label=Maven%20Central&style=for-the-badge)](https://central.sonatype.com/artifact/computer.kolektiv.kord/kord-core) ### Gradle (Kotlin) @@ -72,7 +72,7 @@ repositories { } dependencies { - implementation("dev.kord:kord-core:{version}") + implementation("computer.kolektiv.kord:kord-core:{version}") } ``` @@ -87,7 +87,7 @@ repositories { } dependencies { - implementation("dev.kord:kord-core:{version}") + implementation("computer.kolektiv.kord:kord-core:{version}") } ``` @@ -112,7 +112,7 @@ dependencies { ```xml - dev.kord + computer.kolektiv.kord kord-core-jvm {version} diff --git a/buildSrc/src/main/kotlin/Projects.kt b/buildSrc/src/main/kotlin/Projects.kt index ba50c49794b..bb56793b021 100644 --- a/buildSrc/src/main/kotlin/Projects.kt +++ b/buildSrc/src/main/kotlin/Projects.kt @@ -3,7 +3,7 @@ import org.gradle.api.provider.Provider object Library { const val name = "kord" - const val group = "dev.kord" + const val group = "computer.kolektiv.kord" const val description = "Idiomatic Kotlin Wrapper for The Discord API" const val projectUrl = "https://github.com/kordlib/kord" } diff --git a/buildSrc/src/main/kotlin/kord-publishing.gradle.kts b/buildSrc/src/main/kotlin/kord-publishing.gradle.kts index 229239c094f..1755a95f38e 100644 --- a/buildSrc/src/main/kotlin/kord-publishing.gradle.kts +++ b/buildSrc/src/main/kotlin/kord-publishing.gradle.kts @@ -62,6 +62,21 @@ mavenPublishing { publishing { repositories { + + val ghActor = providers.environmentVariable("GITHUB_ACTOR") + val ghToken = providers.environmentVariable("GITHUB_TOKEN") + if (ghActor.isPresent && ghToken.isPresent) { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/KolektivComputer/kord") + credentials { + username = ghActor.get() + password = ghToken.get() + } + } + } + + // Legacy upstream GH Packages (optional; prefer KolektivComputer above) maven { url = uri("https://maven.pkg.github.com/kordlib/kord") @@ -70,5 +85,22 @@ publishing { password = System.getenv("GITHUB_TOKEN") } } + + val yuriUser = providers.environmentVariable("YURI_CAPITAL_REPO_USERNAME") + val yuriPass = providers.environmentVariable("YURI_CAPITAL_REPO_PASSWORD") + if (yuriUser.isPresent && yuriPass.isPresent) { + val snapshot = libraryVersion.get().endsWith("-SNAPSHOT", ignoreCase = true) + maven { + name = if (snapshot) "yuriSnapshots" else "yuriReleases" + url = uri( + if (snapshot) "https://repo.yuri.capital/repository/maven-snapshots/" + else "https://repo.yuri.capital/repository/maven-releases/" + ) + credentials { + username = yuriUser.get() + password = yuriPass.get() + } + } + } } } diff --git a/docs/CI_DUAL_PUBLISH.md b/docs/CI_DUAL_PUBLISH.md new file mode 100644 index 00000000000..40a4769d5c6 --- /dev/null +++ b/docs/CI_DUAL_PUBLISH.md @@ -0,0 +1,54 @@ +# Dual-publish (GH Packages + Yuri + JSR) + +Org epic: [KolektivComputer/.github#2](https://github.com/KolektivComputer/.github/issues/2) +Spine: [gradle-conventions#1](https://github.com/KolektivComputer/gradle-conventions/pull/1) → plugin `computer.kolektiv.publishing` + +## Maven +- GroupId: `computer.kolektiv.kord` (org family `computer.kolektiv.*`) +- Dual repositories: GitHub Packages `https://maven.pkg.github.com/KolektivComputer/kord` **and** Yuri Capital (`maven-releases` / `maven-snapshots`) when credentials are present +- Prefer `id("computer.kolektiv.publishing")` once the conventions plugin is published; until then repos are inlined to match that plugin + +## npm +- Scope **`@kolektiv/...` only** — do not invent a second JS scope +- Dual: existing Yuri Capital npm (where used) + `https://npm.pkg.github.com` with `@kolektiv:registry=…` +- Auth: `NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}` with `permissions.packages: write` + +## JSR +- Scope `@kolektiv` (owned) +- Actions: OIDC only — `permissions.id-token: write` — **no org `JSR_TOKEN`** +- Mey: link each package on jsr.io for GitHub Actions trusted publishing +- Not a substitute for npm publish + +## Workflow paste (token may lack `workflows` scope) + +```yaml +permissions: + contents: read + packages: write + id-token: write # JSR OIDC +``` + +Maven job env: +```yaml +GITHUB_ACTOR: ${{ github.actor }} +GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# optional Yuri dual: +# YURI_CAPITAL_REPO_USERNAME / YURI_CAPITAL_REPO_PASSWORD (org secrets) +``` + +npm → GitHub Packages: +```yaml +- uses: actions/setup-node@v4 + with: + registry-url: https://npm.pkg.github.com + scope: "@kolektiv" +env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} +``` + +JSR: +```yaml +- run: npx jsr publish +``` + +Kotlin packages remain `dev.kord.*` until a follow-up; Maven group is `computer.kolektiv.kord`.