Skip to content

Commit

Permalink
Add Scaladoc support (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
khajavi authored Jan 12, 2023
1 parent bbb7f9b commit b74c778
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
36 changes: 30 additions & 6 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,31 @@ name: Website
push:
branches:
- master
pull_request: {}
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.3.0
with:
fetch-depth: '0'
- name: Setup Scala
uses: actions/setup-java@v3.9.0
with:
distribution: temurin
java-version: 17
check-latest: true
- name: Check if the README file is up to date
run: sbt docs/checkReadme
- name: Check if the site workflow is up to date
run: sbt docs/checkGithubWorkflow
- name: Check artifacts build process
run: sbt +publishLocal
- name: Check website build process
run: sbt docs/clean; sbt docs/buildWebsite
publish-docs:
name: Publish Docs
runs-on: ubuntu-latest
Expand All @@ -21,7 +45,7 @@ jobs:
with:
fetch-depth: '0'
- name: Setup Scala
uses: actions/setup-java@v3.6.0
uses: actions/setup-java@v3.9.0
with:
distribution: temurin
java-version: 17
Expand All @@ -38,14 +62,15 @@ jobs:
generate-readme:
name: Generate README
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'push') || ((github.event_name == 'release') && (github.event_name == 'published')) }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.3.0
with:
ref: ${{ github.head_ref }}
fetch-depth: '0'
- name: Setup Scala
uses: actions/setup-java@v3.6.0
uses: actions/setup-java@v3.9.0
with:
distribution: temurin
java-version: 17
Expand All @@ -59,16 +84,15 @@ jobs:
git add README.md
git commit -m "Update README.md" || echo "No changes to commit"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v4.2.3
with:
body: |
body: |-
Autogenerated changes after running the `sbt docs/generateReadme` command of the [zio-sbt-website](https://zio.dev/zio-sbt) plugin.
I will automatically update the README.md file whenever there is new change for README.md, e.g.
- After each release, I will update the version in the installation section.
- After any changes to the "docs/index.md" file, I will update the README.md file accordingly.
branch: zio-sbt-website/update-readme
commit-message: Update README.md
branch-suffix: short-commit-hash
delete-branch: true
title: Update README.md

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

> The client is still a work-in-progress. Watch this space!
|Project Stage | CI | Release | Snapshot | Discord | Github |
|--------------|----|---------|----------|---------|--------|
|[![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-redis/workflows/CI/badge.svg) |[![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-redis_2.12.svg)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-redis_2.12/) |[![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-redis_2.12.svg)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-redis_2.12/) |[![Chat on Discord!](https://img.shields.io/discord/629491597070827530?logo=discord)](https://discord.gg/2ccFBr4) |[![ZIO Redis](https://img.shields.io/github/stars/zio/zio-redis?style=social)](https://github.com/zio/zio-redis) |
[![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-redis/workflows/CI/badge.svg) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-redis_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-redis_2.13/) [![ZIO Redis](https://img.shields.io/github/stars/zio/zio-redis?style=social)](https://github.com/zio/zio-redis)

## Introduction

Expand Down
17 changes: 7 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ lazy val root =
project
.in(file("."))
.settings(publish / skip := true)
.aggregate(redis, benchmarks, example)
.aggregate(redis, benchmarks, example, docs)

lazy val redis =
project
Expand Down Expand Up @@ -98,15 +98,12 @@ lazy val docs = project
moduleName := "zio-redis-docs",
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
projectName := "ZIO Redis",
badgeInfo := Some(
BadgeInfo(
artifact = "zio-redis_2.12",
projectStage = ProjectStage.Experimental
)
),
docsPublishBranch := "master",
libraryDependencies += "dev.zio" %% "zio-schema-protobuf" % "0.3.1"
projectName := "ZIO Redis",
mainModuleName := (redis / moduleName).value,
projectStage := ProjectStage.Experimental,
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(redis),
docsPublishBranch := "master",
libraryDependencies += "dev.zio" %% "zio-schema-protobuf" % "0.3.1"
)
.dependsOn(redis)
.enablePlugins(WebsitePlugin)
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.9.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.6")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.2.4")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.4")

libraryDependencies += "org.snakeyaml" % "snakeyaml-engine" % "2.5"

0 comments on commit b74c778

Please sign in to comment.