@zio.dev/zio-sbt 0.8.6 → 0.8.8
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 +26 -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.8")
|
|
16
|
+
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.8.8")
|
|
17
|
+
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.8.8")
|
|
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.8")
|
|
134
134
|
|
|
135
135
|
resolvers ++= Resolver.sonatypeOssRepos("public")
|
|
136
136
|
```
|
|
@@ -194,7 +194,7 @@ The default value mirrors the bots used by the `zio/zio` repository: `Seq(Depend
|
|
|
194
194
|
|
|
195
195
|
> **Note:**
|
|
196
196
|
>
|
|
197
|
-
> `auto-merge.yml` waits for every check on the PR (other than its own bot jobs) to finish and merges with `gh pr merge --squash` only if none failed
|
|
197
|
+
> When the PR's base branch requires status checks (through classic branch protection or a ruleset), `auto-merge.yml` enables GitHub's native auto-merge with `gh pr merge --auto --squash` and finishes at once; GitHub merges the PR when the required checks pass. On a branch without required status checks, where `--auto` would merge before CI finishes, it instead waits for every check on the PR (other than its own bot jobs) to finish and merges with `gh pr merge --squash` only if none failed. A red check fails the job and leaves the PR open. The `workflow_dispatch` backfill still uses `gh pr merge --auto`, which merges immediately on a branch with no required status checks, so configure branch protection with required checks before relying on it.
|
|
198
198
|
|
|
199
199
|
> **Note:**
|
|
200
200
|
>
|
|
@@ -234,6 +234,25 @@ Put together, this makes `ciEnableDeployPreview` safe to turn on before the Docu
|
|
|
234
234
|
|
|
235
235
|
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.
|
|
236
236
|
|
|
237
|
+
#### On-demand previews
|
|
238
|
+
|
|
239
|
+
Every preview deploy costs Netlify credits. To deploy only when someone asks for it, switch the mode:
|
|
240
|
+
|
|
241
|
+
```scala
|
|
242
|
+
import zio.sbt.githubactions.DeployPreviewMode
|
|
243
|
+
|
|
244
|
+
ThisBuild / ciEnableDeployPreview := true
|
|
245
|
+
ThisBuild / ciDeployPreviewMode := DeployPreviewMode.OnDemand
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
`ciDeployPreviewMode` defaults to `DeployPreviewMode.Automatic`, the behavior described above, so nothing changes until you opt in. With `OnDemand`, `deploy-preview.yml` is still generated, but it works differently:
|
|
249
|
+
|
|
250
|
+
1. After a successful pull-request CI run, the `post-preview-comment` job creates one bot comment on the pull request with an unticked **Deploy preview** checkbox. Nothing is deployed yet. A later push resets the same comment to the new commit with the box unticked again.
|
|
251
|
+
2. When someone ticks the box, GitHub fires an `issue_comment` `edited` event and the `deploy-preview` job runs. It first checks that the person who ticked has `admin`, `maintain` or `write` access to the repository and adds a 👍 reaction to the comment to acknowledge the request, then finds the successful `ci.yml` run for the exact commit named in the comment, downloads that run's `website-artifact`, and deploys it to Netlify.
|
|
252
|
+
3. The comment is rewritten with the preview URL, the deploy time and the commit, plus a **Redeploy preview** checkbox. If the deployment fails, the box is unticked again and the comment links to the failed run.
|
|
253
|
+
|
|
254
|
+
Deployments are serialized per pull request (a second tick waits for the first instead of cancelling it). The two Netlify secrets and the `website-artifact` / `pr-metadata` artifacts from `build` are the same as for the automatic mode, and the generated workflow looks up CI by its file name, `ci.yml`.
|
|
255
|
+
|
|
237
256
|
### Release Drafter
|
|
238
257
|
|
|
239
258
|
`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:
|
|
@@ -312,6 +331,7 @@ All settings are `ThisBuild`-scoped.
|
|
|
312
331
|
| `ciSwapSizeGB` | `Int` | `0` | Adds a swap-space step to every job when greater than zero |
|
|
313
332
|
| `ciBackgroundJobs` | `Seq[String]` | `Seq.empty` | Commands prefixed to each `run`, for daemons a job needs |
|
|
314
333
|
| `ciEnableDeployPreview` | `Boolean` | `false` | Adds website-artifact upload steps to `build` and generates `deploy-preview.yml`. Requires `NETLIFY_AUTH_TOKEN`/`NETLIFY_SITE_ID` secrets |
|
|
334
|
+
| `ciDeployPreviewMode` | `DeployPreviewMode` | `DeployPreviewMode.Automatic` | Only used with `ciEnableDeployPreview`. `Automatic` deploys every successful pull-request CI run; `OnDemand` posts a "Deploy preview" checkbox comment and deploys only when it is ticked |
|
|
315
335
|
| `ciEnableReleaseDrafter` | `Boolean` | `true` | Generates `release-drafter.yml` and scaffolds `.github/release-drafter.yml` (once). Overwrites a hand-written `release-drafter.yml` when on; when off, only deletes a copy it generated itself |
|
|
316
336
|
| `ciReleaseDrafterCategories` | `Seq[ReleaseDrafterCategory]` | Features/Bug Fixes/Maintenance/Dependency Updates | Categories written into the scaffolded config on first generation only |
|
|
317
337
|
| `ciReleaseDrafterVersionResolver` | `Option[ReleaseDrafterVersionResolver]` | `None` | Optional `version-resolver` block for the scaffolded config |
|
|
@@ -528,7 +548,7 @@ ZIO SBT Source is a Scala 2.13 + Scala 3 cross-compiled library that provides ut
|
|
|
528
548
|
Add the following line to your `libraryDependencies` in `build.sbt`:
|
|
529
549
|
|
|
530
550
|
```scala
|
|
531
|
-
libraryDependencies += "dev.zio" %% "zio-sbt-source" % "0.8.
|
|
551
|
+
libraryDependencies += "dev.zio" %% "zio-sbt-source" % "0.8.8"
|
|
532
552
|
```
|
|
533
553
|
|
|
534
554
|
### Features
|