@zio.dev/zio-sbt 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.md +46 -6
- package/package.json +1 -1
package/index.md
CHANGED
|
@@ -12,9 +12,9 @@ _ZIO SBT_ contains multiple sbt plugins that are useful for ZIO projects. It pro
|
|
|
12
12
|
Add the following lines to your `project/plugins.sbt` file:
|
|
13
13
|
|
|
14
14
|
```scala
|
|
15
|
-
addSbtPlugin("dev.zio" % "zio-sbt-ecosystem" % "0.8.
|
|
16
|
-
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.8.
|
|
17
|
-
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.8.
|
|
15
|
+
addSbtPlugin("dev.zio" % "zio-sbt-ecosystem" % "0.8.1")
|
|
16
|
+
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.8.1")
|
|
17
|
+
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.8.1")
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Then you can enable them by using the following code in your `build.sbt` file:
|
|
@@ -130,7 +130,7 @@ ZIO SBT CI plugin generates a default GitHub workflow that includes common CI ta
|
|
|
130
130
|
To use ZIO SBT CI plugin, add the following lines to your `plugins.sbt` file:
|
|
131
131
|
|
|
132
132
|
```scala
|
|
133
|
-
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.8.
|
|
133
|
+
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.8.1")
|
|
134
134
|
|
|
135
135
|
resolvers ++= Resolver.sonatypeOssRepos("public")
|
|
136
136
|
```
|
|
@@ -221,6 +221,34 @@ Put together, this makes `ciEnableDeployPreview` safe to turn on before the Docu
|
|
|
221
221
|
|
|
222
222
|
This requires two repository secrets: `NETLIFY_AUTH_TOKEN`, a [personal access token](https://docs.netlify.com/api/get-started/#authentication) generated from the Netlify user account that owns the site, and `NETLIFY_SITE_ID`, found under the site's **Site configuration → General → Site details** in the Netlify dashboard. The default value of `ciEnableDeployPreview` is `false`, so existing builds see no change until they opt in.
|
|
223
223
|
|
|
224
|
+
### Release Drafter
|
|
225
|
+
|
|
226
|
+
`ciEnableReleaseDrafter` defaults to `true`, so `ciGenerateGithubWorkflow` generates `release-drafter.yml` automatically, which runs [`release-drafter/release-drafter`](https://github.com/release-drafter/release-drafter) on every push to the release branch to keep a draft GitHub Release up to date with categorized notes for each merged pull request. Set it to `false` to opt out:
|
|
227
|
+
|
|
228
|
+
```scala
|
|
229
|
+
ThisBuild / ciEnableReleaseDrafter := false
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
The first time the feature generates a `release-drafter.yml`, `ciGenerateGithubWorkflow` also scaffolds `.github/release-drafter.yml` — release-drafter's own config file — from `ciReleaseDrafterCategories`/`ciReleaseDrafterExcludeLabels`/`ciReleaseDrafterAutolabeler`/`ciReleaseDrafterVersionResolver`, if that file doesn't already exist. Unlike every other generated file, it is **never rewritten or deleted afterward**, even if those settings change or `ciEnableReleaseDrafter` is turned back off: category/label taxonomy is inherently per-repo and meant to be hand-customized once scaffolded, so `ciCheckGithubWorkflow`'s drift check does not cover it either — only `.github/workflows/release-drafter.yml` (the workflow file) participates in that check, the same as `ci.yml`/`auto-approve.yml`/`auto-merge.yml`/`deploy-preview.yml`.
|
|
233
|
+
|
|
234
|
+
`release-drafter.yml`'s `push` trigger runs on `ciReleaseDrafterBranch` when set, otherwise the first entry of `ciEnabledBranches`, otherwise `main` — GitHub Actions' static `on.push.branches` list can't use the same `default_branch` runtime expression this plugin uses elsewhere, so a literal branch name is always required. Repos maintaining multiple release series (e.g. `series/2.x`) should set `ciReleaseDrafterBranch` explicitly.
|
|
235
|
+
|
|
236
|
+
This is purely additive: it does not change `ci.yml`'s own triggers or jobs, and it does not publish the draft release automatically — a human still does that, which is what fires the existing `release: published`-gated release jobs. Because the feature defaults to *on*, `release-drafter.yml` is only ever written or deleted if this plugin created it in the first place — identified by the same "autogenerated" header every other generated workflow carries. A repo that already hand-maintains a `release-drafter.yml` (release-drafter's own README convention) sees that file left completely alone, whether `ciEnableReleaseDrafter` is left at its default or set explicitly either way; only a repo where the file doesn't exist yet, or where the plugin already owns it, is affected.
|
|
237
|
+
|
|
238
|
+
### Scala Steward
|
|
239
|
+
|
|
240
|
+
`ciEnableScalaSteward` defaults to `true`, so `ciGenerateGithubWorkflow` generates `scala-steward.yml` automatically, which runs [`scala-steward-org/scala-steward-action`](https://github.com/scala-steward-org/scala-steward-action) on a daily schedule (`ciScalaStewardSchedule`, default `"0 0 * * *"`) to open dependency-update pull requests, authenticating as a GitHub App via the `SCALA_STEWARD_GITHUB_APP_ID`, `SCALA_STEWARD_GITHUB_APP_INSTALLATION_ID` and `SCALA_STEWARD_GITHUB_APP_PRIVATE_KEY` repository secrets. Set it to `false` to opt out:
|
|
241
|
+
|
|
242
|
+
```scala
|
|
243
|
+
ThisBuild / ciEnableScalaSteward := false
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
`ciScalaStewardTimeoutMinutes` (default `45`), `ciScalaStewardPermissions` (default `contents: read` — the action authenticates via the GitHub App's installation token, since `github-app-auth-only` is always set, so no write scope is needed by default) and `ciScalaStewardWorkflowEnv` (default empty; a repo needing JVM tuning during dependency resolution sets `JDK_JAVA_OPTIONS`/similar here) all override the generated job.
|
|
247
|
+
|
|
248
|
+
The first time this feature renders a non-empty `.scala-steward.conf` from `ciScalaStewardConfig`, it scaffolds that file at the repository root, if it does not already exist. Like `.github/release-drafter.yml`, it is **never rewritten or deleted afterward**, even if `ciScalaStewardConfig` changes or `ciEnableScalaSteward` is turned back off — repo-specific pins/ignores/grouping are meant to be hand-customized once scaffolded, and `ciCheckGithubWorkflow`'s drift check does not cover it either, only `.github/workflows/scala-steward.yml` does. An all-default `ciScalaStewardConfig` renders to nothing, so most repos never see this file at all unless they set it.
|
|
249
|
+
|
|
250
|
+
This is purely additive: it does not change `ci.yml`'s own triggers or jobs. Because the feature defaults to *on*, `scala-steward.yml` is only ever written or deleted if this plugin created it in the first place — identified by the same "autogenerated" header every other generated workflow carries. A repo that already hand-maintains a `scala-steward.yml` (as every ZIO-ecosystem repo currently does) sees that file left completely alone until it is deliberately deleted so the plugin can take ownership.
|
|
251
|
+
|
|
224
252
|
### Keeping the Workflow in Sync
|
|
225
253
|
|
|
226
254
|
The generated files are meant to be committed and never edited by hand. To stop them drifting from the build, run the check in CI — the default `lint` job already does:
|
|
@@ -248,6 +276,18 @@ All settings are `ThisBuild`-scoped.
|
|
|
248
276
|
| `ciSwapSizeGB` | `Int` | `0` | Adds a swap-space step to every job when greater than zero |
|
|
249
277
|
| `ciBackgroundJobs` | `Seq[String]` | `Seq.empty` | Commands prefixed to each `run`, for daemons a job needs |
|
|
250
278
|
| `ciEnableDeployPreview` | `Boolean` | `false` | Adds website-artifact upload steps to `build` and generates `deploy-preview.yml`. Requires `NETLIFY_AUTH_TOKEN`/`NETLIFY_SITE_ID` secrets |
|
|
279
|
+
| `ciEnableReleaseDrafter` | `Boolean` | `true` | Generates `release-drafter.yml` and scaffolds `.github/release-drafter.yml` (once). Only writes/deletes a `release-drafter.yml` it generated itself, whether on or off |
|
|
280
|
+
| `ciReleaseDrafterCategories` | `Seq[ReleaseDrafterCategory]` | Features/Bug Fixes/Maintenance/Dependency Updates | Categories written into the scaffolded config on first generation only |
|
|
281
|
+
| `ciReleaseDrafterVersionResolver` | `Option[ReleaseDrafterVersionResolver]` | `None` | Optional `version-resolver` block for the scaffolded config |
|
|
282
|
+
| `ciReleaseDrafterAutolabeler` | `Seq[ReleaseDrafterAutolabelerRule]` | `Seq.empty` | Optional `autolabeler` rules for the scaffolded config |
|
|
283
|
+
| `ciReleaseDrafterExcludeLabels` | `Seq[String]` | `Seq("skip-changelog")` | `exclude-labels` for the scaffolded config |
|
|
284
|
+
| `ciReleaseDrafterBranch` | `Option[Branch]` | `None` | Branch `release-drafter.yml`'s `push` trigger runs on. Falls back to the first of `ciEnabledBranches`, then `"main"` |
|
|
285
|
+
| `ciEnableScalaSteward` | `Boolean` | `true` | Generates `scala-steward.yml` and scaffolds `.scala-steward.conf` (once, only if non-empty). Only writes/deletes a `scala-steward.yml` it generated itself, whether on or off |
|
|
286
|
+
| `ciScalaStewardSchedule` | `String` | `"0 0 * * *"` | Cron schedule for `scala-steward.yml`'s `schedule` trigger |
|
|
287
|
+
| `ciScalaStewardTimeoutMinutes` | `Int` | `45` | `timeout-minutes` for the scala-steward job |
|
|
288
|
+
| `ciScalaStewardPermissions` | `Map[String, String]` | `contents: read` | Permissions block for `scala-steward.yml`; the action authenticates via the GitHub App's installation token, not `GITHUB_TOKEN`, so no write scope is needed by default |
|
|
289
|
+
| `ciScalaStewardWorkflowEnv` | `Map[String, String]` | `Map.empty` | Extra env vars for the scala-steward job |
|
|
290
|
+
| `ciScalaStewardConfig` | `ScalaStewardConfig` | `ScalaStewardConfig()` | Settings scaffolded into `.scala-steward.conf` on first non-empty render |
|
|
251
291
|
|
|
252
292
|
**Test matrix**
|
|
253
293
|
|
|
@@ -290,7 +330,7 @@ All settings are `ThisBuild`-scoped.
|
|
|
290
330
|
|
|
291
331
|
| Task | Description |
|
|
292
332
|
| --- | --- |
|
|
293
|
-
| `ciGenerateGithubWorkflow` | Writes `ci.yml`, `auto-approve.yml` and `auto-merge.yml`, plus `deploy-preview.yml` when `ciEnableDeployPreview` is `true` |
|
|
333
|
+
| `ciGenerateGithubWorkflow` | Writes `ci.yml`, `auto-approve.yml` and `auto-merge.yml`, plus `deploy-preview.yml` when `ciEnableDeployPreview` is `true` and `release-drafter.yml` (and scaffolds `.github/release-drafter.yml` once) when `ciEnableReleaseDrafter` is `true`, and scala-steward.yml (and scaffolds .scala-steward.conf once, when ciScalaStewardConfig renders non-empty content) when ciEnableScalaSteward is true |
|
|
294
334
|
| `ciCheckGithubWorkflow` | Regenerates and fails if the committed files are stale |
|
|
295
335
|
| `ciGenerateAutoApproveWorkflow` | Writes `auto-approve.yml` only |
|
|
296
336
|
| `ciGenerateAutoMergeWorkflow` | Writes `auto-merge.yml` only |
|
|
@@ -435,7 +475,7 @@ ZIO SBT Source is a Scala 2.13 + Scala 3 cross-compiled library that provides ut
|
|
|
435
475
|
Add the following line to your `libraryDependencies` in `build.sbt`:
|
|
436
476
|
|
|
437
477
|
```scala
|
|
438
|
-
libraryDependencies += "dev.zio" %% "zio-sbt-source" % "0.8.
|
|
478
|
+
libraryDependencies += "dev.zio" %% "zio-sbt-source" % "0.8.1"
|
|
439
479
|
```
|
|
440
480
|
|
|
441
481
|
### Features
|