Skip to content

Commit

Permalink
Merge pull request #181 from armanbilge/doc/minimum-viable-example
Browse files Browse the repository at this point in the history
Demonstrate a "minimum viable project" in the quick start
  • Loading branch information
armanbilge authored Feb 20, 2022
2 parents aea6e51 + 777a2bf commit ab63dbc
Showing 1 changed file with 50 additions and 6 deletions.
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)

0 comments on commit ab63dbc

Please sign in to comment.