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

Demonstrate a "minimum viable project" in the quick start #181

Merged
Merged
Changes from all 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
56 changes: 50 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,70 @@ sbt-typelevel helps Scala projects to publish early-semantically-versioned, bina
[![sbt-typelevel Scala version support](https://index.scala-lang.org/typelevel/sbt-typelevel/sbt-typelevel/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/typelevel/sbt-typelevel/sbt-typelevel)
[![Discord](https://img.shields.io/discord/632277896739946517.svg?label=&logo=discord&logoColor=ffffff&color=404244&labelColor=6A7EC2)](https://discord.gg/D7wY3aH7BQ)

```scala
// Pick one, for project/plugins.sbt
Pick either the `sbt-typelevel` (recommended) or `sbt-typelevel-ci-release` plugin.

#### `project/plugins.sbt`

```scala
// Full service, batteries-included, let's go!
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "@VERSION@")

// Set me up for CI release, but don't touch my scalacOptions!
addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "@VERSION@")
```

// Then, in your build.sbt
Then configure your build.

#### `build.sbt`

```scala
ThisBuild / tlBaseVersion := "0.4" // your current series x.y
ThisBuild / developers +=
tlGitHubDev("armanbilge", "Arman Bilge") // your GitHub handle and name

ThisBuild / organization := "org.typelevel"
ThisBuild / organizationName := "Typelevel"
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / developers := Seq(
// your GitHub handle and name
tlGitHubDev("armanbilge", "Arman Bilge")
)

// true by default, set to false to publish to s01.oss.sonatype.org
ThisBuild / tlSonatypeUseLegacyHost := true

val Scala213 = "2.13.8"
ThisBuild / crossScalaVersions := Seq(Scala213, "3.1.1")
ThisBuild / scalaVersion := Scala213 // the default Scala

lazy val root = tlCrossRootProject.aggregate(core, extra, tests)

lazy val core = crossProject(JVMPlatform, JSPlatform)
.in(file("core"))
.settings(
name := "woozle-core",
libraryDependencies += "org.typelevel" %%% "cats-core" % "2.7.0"
)

lazy val extra = project
.in(file("extra"))
.dependsOn(core.jvm)
.settings(name := "woozle-extra")

lazy val tests = crossProject(JVMPlatform, JSPlatform)
.in(file("tests"))
.enablePlugins(NoPublishPlugin)
.dependsOn(core)
.settings(
name := "woozle-tests",
libraryDependencies += "org.scalacheck" %%% "scalacheck" % "1.15.4" % Test
)
```

Next, run `githubWorkflowGenerate` in sbt to automatically generate the GitHub Actions workflows.
This will create a build matrix with axes for Scala version and target platform (JVM, JS, etc.).
It will also setup a job for publishing tagged releases e.g. `v0.4.5` to Sonatype/Maven.

Finally, on GitHub set the following secrets on your repository:

- `SONATYPE_USERNAME` and `SONATYPE_PASSWORD`
- `PGP_SECRET`: output of `gpg --armor --export-secret-keys $LONG_ID | base64`
- `PGP_PASSPHRASE` (optional, use only if your key is passphrase-protected)