@zio.dev/zio-sbt 0.3.10 → 0.4.0-alpha.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.
Files changed (2) hide show
  1. package/index.md +55 -1
  2. package/package.json +1 -1
package/index.md CHANGED
@@ -12,7 +12,7 @@ _ZIO SBT_ is an sbt plugin for ZIO projects. It provides high-level SBT utilitie
12
12
  Add the following lines to your `plugin.sbt` file:
13
13
 
14
14
  ```scala
15
- addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10")
15
+ addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.4.0-alpha.1")
16
16
  ```
17
17
 
18
18
  Then you can enable it by using the following code in your `build.sbt` file:
@@ -31,3 +31,57 @@ ZIO SBT Website is an SBT plugin that has the following tasks:
31
31
  - `sbt publishToNpm`— publishes documentation inside the `docs` directory to the npm registry.
32
32
  - `sbt generateGithubWorkflow`— generates GitHub workflow which publishes documentation for each library release.
33
33
  - `sbt generateReadme`— generate README.md file from `docs/index.md` and sbt setting keys.
34
+
35
+ ## ZIO SBT CI Plugin
36
+
37
+ ZIO SBT CI is an sbt plugin which generates a GitHub workflow for a project, making it easier to set up continuous integration (CI) pipelines for Scala projects. With this plugin, developers can streamline their development workflow by automating the testing and deployment process, reducing manual effort and errors. The plugin is designed to work seamlessly with sbt, the popular build tool for Scala projects, and integrates smoothly with GitHub Actions, the CI/CD platform provided by GitHub.
38
+
39
+ ZIO SBT CI provides a simple and efficient way to configure, manage, and run CI pipelines, helping teams to deliver high-quality software faster and with greater confidence.
40
+
41
+ ZIO SBT CI plugin generates a default GitHub workflow that includes common CI tasks such as building, testing, and publishing artifacts. However, users can also manually customize the workflow. This plugin is designed to be flexible and extensible, making it easy for users to tailor the workflow to their specific needs. Additionally, the plugin also provides tons of optional sbt settings that users can modify to change various aspects of the generated workflow. Overall, ZIO SBT CI plugin strikes a balance between automation and flexibility, allowing users to automate their CI process while still giving them control over how the workflow is generated.
42
+
43
+ ### Getting Started
44
+
45
+ To use ZIO SBT CI plugin, add the following lines to your `plugins.sbt` file:
46
+
47
+ ```scala
48
+ addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.4.0-alpha.1")
49
+
50
+ resolvers ++= Resolver.sonatypeOssRepos("public")
51
+ ```
52
+
53
+ Then in your `build.sbt` file, enable the plugin by adding the following line:
54
+
55
+ ```scala
56
+ enablePlugins(ZioSbtCiPlugin)
57
+ ```
58
+
59
+ Now you can generate a Github workflow by running the following command:
60
+
61
+ ```bash
62
+ sbt ciGenerateGithubWorkflow
63
+ ```
64
+
65
+ The `ciTargetScalaVersions` setting key is used to define a mapping of project names to the Scala versions that should be used for testing phase of continuous integration (CI).
66
+
67
+ In the example provided, `ciTargetScalaVersions` is defined at the `ThisBuild` level, meaning that the setting will apply to all projects within the build. The setting defines a Map where the key is the name of the current project, obtained by calling the `id` method on the `thisProject` setting, and the value is a sequence of Scala versions obtained from the `crossScalaVersions` of each submodule setting.
68
+
69
+ By default, sbt will run the test task for each project in the build using the default `ThisBuild / crossScalaVersion` (not implemented yet). However, this may not be sufficient for projects that need to be tested against multiple Scala versions, such as libraries or frameworks that support different versions of Scala. In such cases, the `ciTargetScalaVersions` setting can be used to define the Scala versions supported by each submodule.
70
+
71
+ For example, suppose we have a project with the name "submoduleA" and we want to test it against Scala `2.11.12` and `2.12.17`, and for the "submoduleB" we want to test it against Scala `2.12.17` and `2.13.10` and `3.2.2`, We can define the `ciTargetScalaVersions` setting as follows:
72
+
73
+ ```scala
74
+ ThisBuild / ciTargetScalaVersions := Map(
75
+ "submoduleA" -> Seq("2.11.12", "2.12.17"),
76
+ "submoduleB" -> Seq("2.12.17", "2.13.10", "3.2.2")
77
+ )
78
+ ```
79
+
80
+ To simplify this process, we can populate the versions using each submodule's crossScalaVersions setting as follows:
81
+
82
+ ```scala
83
+ ThisBuild / ciTargetScalaVersions := Map(
84
+ (submoduleA / thisProject).value.id -> (submoduleA / crossScalaVersions).value,
85
+ (submoduleB / thisProject).value.id -> (submoduleB / crossScalaVersions).value
86
+ )
87
+ ```
package/package.json CHANGED
@@ -2,5 +2,5 @@
2
2
  "name": "@zio.dev/zio-sbt",
3
3
  "description": "ZIO SBT Documentation",
4
4
  "license": "Apache-2.0",
5
- "version": "0.3.10"
5
+ "version": "0.4.0-alpha.1"
6
6
  }