Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ information on how to get started. And thank you for your interest in this
project!

## License
This project is provided under the [MIT license](LICENSE).
This project is provided under the [MIT license](LICENSE).
## Maven

```kotlin
implementation("computer.kolektiv.kraft:kraft:<version>")
```

GroupId: `computer.kolektiv.kraft` (Kotlin packages still `sh.illumi.kraft.*` until a follow-up). Dual-publish: see `docs/CI_DUAL_PUBLISH.md`.
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
alias(libs.plugins.vanniktech.mavenPublish) apply false
}

group = "sh.illumi.kraft"
group = "computer.kolektiv.kraft"
version = "0.0.2"

allprojects {
Expand All @@ -22,3 +22,5 @@ allprojects {
google()
}
}

apply(from = "gradle/gh-packages.gradle.kts")
54 changes: 54 additions & 0 deletions docs/CI_DUAL_PUBLISH.md
Original file line number Diff line number Diff line change
@@ -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.kraft` (org family `computer.kolektiv.*`)
- Dual repositories: GitHub Packages `https://maven.pkg.github.com/KolektivComputer/kraft` **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 source packages remain `sh.illumi.kraft.*` until a follow-up rename; Maven group is `computer.kolektiv.kraft`.
42 changes: 42 additions & 0 deletions gradle/gh-packages.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import org.gradle.api.publish.PublishingExtension

/**
* Dual-publish repos matching computer.kolektiv.publishing
* (gradle-conventions#1). Inline until the plugin is published.
*/
subprojects {
pluginManager.withPlugin("maven-publish") {
extensions.configure<PublishingExtension>("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/kraft")
credentials {
username = ghActor.get()
password = ghToken.get()
}
}
}
val yuriUser = providers.environmentVariable("YURI_CAPITAL_REPO_USERNAME")
val yuriPass = providers.environmentVariable("YURI_CAPITAL_REPO_PASSWORD")
if (yuriUser.isPresent && yuriPass.isPresent) {
val snapshot = version.toString().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()
}
}
}
}
}
}
}
Loading