Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding site #10

Merged
merged 7 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 49 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: mkdir -p toolkit/js/target target toolkit/native/target .js/target toolkit/jvm/target .jvm/target .native/target project/target
run: mkdir -p toolkit/js/target target toolkit/native/target .js/target site/target toolkit/jvm/target .jvm/target .native/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
run: tar cf targets.tar toolkit/js/target target toolkit/native/target .js/target toolkit/jvm/target .jvm/target .native/target project/target
run: tar cf targets.tar toolkit/js/target target toolkit/native/target .js/target site/target toolkit/jvm/target .jvm/target .native/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
Expand Down Expand Up @@ -293,3 +293,50 @@ jobs:

- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2

site:
name: Generate Site
strategy:
matrix:
os: [ubuntu-latest]
scala: [3.2.2]
java: [temurin@17]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
with:
distribution: jdkfile
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Generate site
run: sbt '++ ${{ matrix.scala }}' docs/tlSite

- name: Publish site
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3.9.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/target/docs/site
keep_files: true
8 changes: 8 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ pull_request_rules:
- status-success=Build and Test (ubuntu-latest, 3, temurin@17, rootNative)
actions:
merge: {}
- name: Label site PRs
conditions:
- files~=^site/
actions:
label:
add:
- site
remove: []
- name: Label toolkit PRs
conditions:
- files~=^toolkit/
Expand Down
34 changes: 32 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import laika.helium.config._

ThisBuild / tlBaseVersion := "0.0"
ThisBuild / startYear := Some(2023)

ThisBuild / tlSitePublishBranch := Some("main")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17"))
ThisBuild / mergifyStewardConfig ~= {
_.map(_.copy(author = "typelevel-steward[bot]"))
}

ThisBuild / crossScalaVersions := Seq("2.12.17", "2.13.10", "3.2.2")

lazy val root = tlCrossRootProject.aggregate(toolkit)
lazy val root = tlCrossRootProject.aggregate(toolkit, docs)
TonioGela marked this conversation as resolved.
Show resolved Hide resolved

lazy val toolkit = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("toolkit"))
Expand All @@ -26,3 +28,31 @@ lazy val toolkit = crossProject(JVMPlatform, JSPlatform, NativePlatform)
),
mimaPreviousArtifacts := Set()
)

lazy val docs = project
.in(file("site"))
.enablePlugins(TypelevelSitePlugin)
.settings(
tlSiteHelium ~= {
_.site.mainNavigation(
appendLinks = List(
ThemeNavigationSection(
"Related Projects",
TextLink.external("https://github.com/typelevel/cats", "cats"),
TextLink.external(
"https://github.com/typelevel/cats-effect",
"cats-effect"
),
TextLink.external("https://github.com/typelevel/fs2", "fs2"),
TextLink.external("https://github.com/http4s/http4s", "http4s"),
TextLink.external("https://github.com/circe/circe", "circe"),
TextLink.external("https://github.com/bkirwi/decline", "decline"),
TextLink.external(
"https://github.com/typelevel/munit-cats-effect",
"munit-cats-effect"
)
)
)
)
}
)
3 changes: 3 additions & 0 deletions docs/directory.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
laika.navigationOrder = [
index.md
]
16 changes: 16 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# typelevel-toolkit

A toolkit of great libraries to start building Typelevel apps on JVM, Node.js, and Native!

Our very own flavour of the [Scala Toolkit](https://github.com/VirtusLab/toolkit).

## Quick start

```scala
//> using lib "org.typelevel::toolkit::@VERSION@"

import cats.effect.*

object Hello extends IOApp.Simple:
def run = IO.println("Hello toolkit!")
```
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
val sbtTlVersion = "0.5.0-M9"
addSbtPlugin("org.typelevel" % "sbt-typelevel" % sbtTlVersion)
addSbtPlugin("org.typelevel" % "sbt-typelevel-mergify" % sbtTlVersion)
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % sbtTlVersion)
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.10")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")