Skip to content

Commit 6990fcb

Browse files
authored
Add Scaladoc Support (zio-archive#450)
* add scaladoc support. * remove depends on. * try fixing ci, part one. * remove extra settings. * remove std settings. * just scala 213 for docs. * remove keeper from unidoc. * update zio-sbt-website plugin. * ignore version on index.md file. * update readme. * update scala version. * ignore docs from publishing. * remove check artifact build process.
1 parent e4af34b commit 6990fcb

File tree

6 files changed

+92
-56
lines changed

6 files changed

+92
-56
lines changed

.github/workflows/site.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,40 @@ name: Website
1010
push:
1111
branches:
1212
- master
13+
pull_request: {}
1314
jobs:
15+
build:
16+
name: Build and Test
17+
runs-on: ubuntu-latest
18+
if: ${{ github.event_name == 'pull_request' }}
19+
steps:
20+
- name: Git Checkout
21+
uses: actions/checkout@v3.3.0
22+
with:
23+
fetch-depth: '0'
24+
- name: Setup Scala
25+
uses: actions/setup-java@v3.9.0
26+
with:
27+
distribution: temurin
28+
java-version: 17
29+
check-latest: true
30+
- name: Check if the README file is up to date
31+
run: sbt docs/checkReadme
32+
- name: Check if the site workflow is up to date
33+
run: sbt docs/checkGithubWorkflow
34+
- name: Check website build process
35+
run: sbt docs/clean; sbt docs/buildWebsite
1436
publish-docs:
1537
name: Publish Docs
1638
runs-on: ubuntu-latest
1739
if: ${{ ((github.event_name == 'release') && (github.event.action == 'published')) || (github.event_name == 'workflow_dispatch') }}
1840
steps:
1941
- name: Git Checkout
20-
uses: actions/checkout@v3.1.0
42+
uses: actions/checkout@v3.3.0
2143
with:
2244
fetch-depth: '0'
2345
- name: Setup Scala
24-
uses: actions/setup-java@v3.6.0
46+
uses: actions/setup-java@v3.9.0
2547
with:
2648
distribution: temurin
2749
java-version: 17
@@ -38,14 +60,15 @@ jobs:
3860
generate-readme:
3961
name: Generate README
4062
runs-on: ubuntu-latest
63+
if: ${{ (github.event_name == 'push') || ((github.event_name == 'release') && (github.event.action == 'published')) }}
4164
steps:
4265
- name: Git Checkout
43-
uses: actions/checkout@v3.1.0
66+
uses: actions/checkout@v3.3.0
4467
with:
4568
ref: ${{ github.head_ref }}
4669
fetch-depth: '0'
4770
- name: Setup Scala
48-
uses: actions/setup-java@v3.6.0
71+
uses: actions/setup-java@v3.9.0
4972
with:
5073
distribution: temurin
5174
java-version: 17
@@ -59,15 +82,15 @@ jobs:
5982
git add README.md
6083
git commit -m "Update README.md" || echo "No changes to commit"
6184
- name: Create Pull Request
62-
uses: peter-evans/create-pull-request@v4
85+
uses: peter-evans/create-pull-request@v4.2.3
6386
with:
64-
title: Update README.md
65-
commit-message: Update README.md
66-
branch: zio-sbt-website/update-readme
67-
body: |
87+
body: |-
6888
Autogenerated changes after running the `sbt docs/generateReadme` command of the [zio-sbt-website](https://zio.dev/zio-sbt) plugin.
6989
7090
I will automatically update the README.md file whenever there is new change for README.md, e.g.
7191
- After each release, I will update the version in the installation section.
7292
- After any changes to the "docs/index.md" file, I will update the README.md file accordingly.
73-
93+
branch: zio-sbt-website/update-readme
94+
commit-message: Update README.md
95+
delete-branch: true
96+
title: Update README.md

README.md

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,60 @@
1+
[//]: # (This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.)
2+
[//]: # (So please do not edit it manually. Instead, change "docs/index.md" file or sbt setting keys)
3+
[//]: # (e.g. "readmeDocumentation" and "readmeSupport".)
4+
15
# ZIO Keeper
26

3-
| Project Stage | CI | Issues | Discord |
4-
| ------------------------------------- |-----------------|-------------------------------------------------------------|-------------------------------------------|
5-
| [![Project stage][Stage]][Stage-Page] | ![CI][Badge-CI] | [![Is it maintained?][Badge-Maintenance]][Link-Maintenance] | [![Discord][Badge-Discord]][Link-Discord] |
7+
ZIO Keeper is a purely-functional, type-safe library for building distributed systems.
8+
9+
[![Experimental](https://img.shields.io/badge/Project%20Stage-Experimental-yellowgreen.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-keeper/workflows/CI/badge.svg) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-keeper_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-keeper_2.13/) [![ZIO Keeper](https://img.shields.io/github/stars/zio/zio-keeper?style=social)](https://github.com/zio/zio-keeper)
610

7-
ZIO Keeper is a purely-functional, type-safe library for building distributed
8-
systems.
11+
## Introduction
912

10-
It provides numerous primitives for tackling the common problems in distributed
11-
computing (e.g. leader election, cluster forming etc.). Under the hood, the
12-
library is backed by [ZIO][Link-ZIO] and [ZIO NIO][Link-NIO], profiting from their
13-
performant, type and resource-safe APIs.
13+
It provides numerous primitives for tackling the common problems in distributed computing (e.g. leader election, cluster forming etc.).
1414

15+
Under the hood, the library is backed by [ZIO][Link-ZIO] and [ZIO NIO][Link-NIO], profiting from their performant, type and resource-safe APIs:
1516
- **Composable**. Design complex systems by composing the available building blocks.
1617
- **Resilient**. Build apps with automated failure recovery.
1718
- **Secure**. Benefit from security guarantees built into the library core.
1819

19-
To learn more about ZIO Keeper, check out the following references:
20+
From the high-level perspective, the library can be separated into the following
21+
"modules":
22+
- transport
23+
- membership
24+
- consensus
25+
26+
## Installation
27+
28+
In order to use this library, we need to add the following line in our `build.sbt` file:
2029

21-
- [Homepage](https://zio.dev/zio-keeper/)
22-
- [Contributor's guide](./.github/CONTRIBUTING.md)
23-
- [License](LICENSE)
24-
- [Issues](https://github.com/zio/zio-keeper/issues)
25-
- [Milestones](https://github.com/zio/zio-keeper/milestones?direction=asc&sort=title&state=open)
26-
- [Pull Requests](https://github.com/zio/zio-keeper/pulls)
30+
```scala
31+
libraryDependencies += "dev.zio" %% "zio-keeper" % "<version>"
32+
33+
resolvers += Resolver.sonatypeRepo("snapshots")
34+
```
2735

28-
[Badge-CI]: https://github.com/zio/zio-keeper/workflows/CI/badge.svg
29-
[Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord
30-
[Badge-Maintenance]: http://isitmaintained.com/badge/resolution/zio/zio-keeper.svg
31-
[Link-Discord]: https://discord.gg/2ccFBr4
32-
[Link-Maintenance]: http://isitmaintained.com/project/zio/zio-keeper
3336
[Link-ZIO]: https://zio.dev
3437
[Link-NIO]: https://zio.github.io/zio-nio/
35-
[Stage]: https://img.shields.io/badge/Project%20Stage-Experimental-yellow.svg
36-
[Stage-Page]: https://github.com/zio/zio/wiki/Project-Stages
3738

39+
## Documentation
40+
41+
Learn more on the [ZIO Keeper homepage](https://zio.dev/zio-keeper/)!
42+
43+
## Contributing
44+
45+
For the general guidelines, see ZIO [contributor's guide](https://zio.dev/about/contributing).
46+
47+
## Code of Conduct
48+
49+
See the [Code of Conduct](https://zio.dev/about/code-of-conduct)
50+
51+
## Support
52+
53+
Come chat with us on [![Badge-Discord]][Link-Discord].
54+
55+
[Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord "chat on discord"
56+
[Link-Discord]: https://discord.gg/2ccFBr4 "Discord"
57+
58+
## License
59+
60+
[License](LICENSE)

build.sbt

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck"
3939

4040
lazy val root = project
4141
.in(file("."))
42+
.settings(crossScalaVersions := Seq(Scala212, Scala213))
4243
.settings(skip in publish := true)
43-
.aggregate(keeper, examples)
44+
.aggregate(keeper, examples, docs)
4445

4546
lazy val keeper = project
4647
.in(file("keeper"))
@@ -80,24 +81,15 @@ lazy val examples = project
8081
lazy val docs = project
8182
.in(file("zio-keeper-docs"))
8283
.settings(
83-
skip in publish := true,
84+
publish / skip := true,
8485
moduleName := "zio-keeper-docs",
85-
unusedCompileDependenciesFilter -= moduleFilter("org.scalameta", "mdoc"),
86-
scalacOptions -= "-Yno-imports",
87-
scalacOptions -= "-Xfatal-warnings",
88-
scalacOptions ~= { _.filterNot(_.startsWith("-Ywarn")) },
89-
scalacOptions ~= { _.filterNot(_.startsWith("-Xlint")) },
90-
libraryDependencies ++= Seq(
91-
("com.github.ghik" % "silencer-lib" % "1.6.0" % Provided).cross(CrossVersion.full)
92-
),
86+
scalaVersion := Scala213,
87+
crossScalaVersions := Seq(Scala213),
88+
mainModuleName := (keeper / moduleName).value,
9389
projectName := "ZIO Keeper",
94-
badgeInfo := Some(
95-
BadgeInfo(
96-
artifact = "zio-keeper_2.12",
97-
projectStage = ProjectStage.Experimental
98-
)
99-
),
90+
projectStage := ProjectStage.Experimental,
91+
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(),
92+
checkArtifactBuildProcessWorkflowStep := None,
10093
docsPublishBranch := "master"
10194
)
102-
.dependsOn(keeper)
10395
.enablePlugins(WebsitePlugin)

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ From the high-level perspective, the library can be separated into the following
2828
In order to use this library, we need to add the following line in our `build.sbt` file:
2929

3030
```scala
31-
libraryDependencies += "dev.zio" %% "zio-keeper" % "@VERSION@"
31+
libraryDependencies += "dev.zio" %% "zio-keeper" % "<version>"
3232

3333
resolvers += Resolver.sonatypeRepo("snapshots")
3434
```

project/BuildHelper.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ object BuildHelper {
1111
incOptions ~= (_.withLogRecompileOnMacro(false))
1212
)
1313

14-
final private val Scala212 = "2.12.10"
15-
final private val Scala213 = "2.13.1"
14+
final val Scala212 = "2.12.17"
15+
final val Scala213 = "2.13.10"
1616

1717
final val ZioVersion = "1.0.0"
1818
final val NioVersion = "1.0.0-RC9"

project/plugins.sbt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5")
33
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16")
44
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
55
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.14")
6-
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.2.4")
7-
8-
resolvers += Resolver.sonatypeRepo("public")
6+
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.9")

0 commit comments

Comments
 (0)