-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
123 lines (97 loc) · 4.17 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import xerial.sbt.Sonatype._
import ReleaseTransformations._
name := "weaver-test-extra"
ThisBuild / organization := "io.github.dimitarg"
ThisBuild / scalaVersion := "2.13.15"
ThisBuild / crossScalaVersions := Seq("2.13.15", "2.12.20", "3.3.4")
ThisBuild / githubWorkflowScalaVersions := Seq("2.13.15", "2.12.20", "3.3.4")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("21"))
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(
commands = List("scalafmtCheck")
),
WorkflowStep.Sbt(
// scoverage plugin not yet supporting scala 2.13.15
// commands = List("coverage", "test"),
commands = List("test"),
env = Map(
"HONEYCOMB_WRITE_KEY" -> "${{ secrets.HONEYCOMB_WRITE_KEY }}",
)
),
// scoverage plugin not yet supporting scala 2.13.15
// WorkflowStep.Sbt(List("coverageReport")),
)
ThisBuild / githubWorkflowEnv += "CODECOV_TOKEN" -> "${{ secrets.CODECOV_TOKEN }}"
ThisBuild / githubWorkflowEnv += "PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}"
ThisBuild / githubWorkflowEnv += "PGP_SECRET" -> "${{ secrets.PGP_SECRET }}"
ThisBuild / githubWorkflowEnv += "SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
ThisBuild / githubWorkflowEnv += "SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}"
ThisBuild / githubWorkflowTargetBranches := Seq("master")
ThisBuild / githubWorkflowPublishTargetBranches += RefPredicate.Equals(Ref.Branch("master"))
ThisBuild / licenses += ("Apache-2.0", url("https://opensource.org/licenses/Apache-2.0"))
// scoverage plugin not yet supporting scala 2.13.15
// ThisBuild / githubWorkflowBuildPostamble := Seq(WorkflowStep.Run(
// commands = List("bash <(curl -s https://codecov.io/bash)")
// ))
ThisBuild / githubWorkflowPublishPreamble := Seq(WorkflowStep.Run(
List(
"git config user.name \"Github Actions (dimitarg/weaver-test-extra)\"",
"git config user.email \"[email protected]\"",
"gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 7A723A868B1FD65C8108ACAF00437AAD7A33298A",
"echo $PGP_SECRET | base64 --decode --ignore-garbage | gpg --batch --passphrase $PGP_PASSPHRASE --import"
)
))
ThisBuild / githubWorkflowPublish := Seq(WorkflowStep.Sbt(List("release cross with-defaults")))
val weaverVersion = "0.8.4"
val natchezVersion = "0.3.7"
val fs2Version = "3.11.0"
libraryDependencies ++=Seq(
"com.disneystreaming" %% "weaver-scalacheck" % weaverVersion,
"com.disneystreaming" %% "weaver-cats" % weaverVersion,
"org.tpolecat" %% "natchez-core" % natchezVersion,
"org.tpolecat" %% "natchez-noop" % natchezVersion % "test",
"org.tpolecat" %% "natchez-honeycomb" % natchezVersion % "test",
"co.fs2" %% "fs2-io" % fs2Version % "test",
)
testFrameworks += new TestFramework("weaver.framework.CatsEffect")
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) =>
List(
compilerPlugin("org.typelevel" % "kind-projector" % "0.13.3" cross CrossVersion.full)
)
case _ =>
Nil
}
}
ThisBuild / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12 | 13)) => Seq("-Xsource:3-cross", "-P:kind-projector:underscore-placeholders")
case _ => Nil
}
}
releasePublishArtifactsAction := PgpKeys.publishSigned.value
usePgpKeyHex("7A723A868B1FD65C8108ACAF00437AAD7A33298A")
ThisBuild / publishTo := sonatypePublishToBundle.value
sonatypeCredentialHost := sonatypeCentralHost
ThisBuild / publishMavenStyle := true
sonatypeProjectHosting := Some(GitHubHosting("dimitarg", "weaver-test-extra", "[email protected]"))
developers := List(
Developer(id="dimitarg", name="Dimitar Georgiev", email="[email protected]", url=url("https://dimitarg.github.io/"))
)
releaseCrossBuild := true // true if you cross-build the project for multiple Scala versions
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
// For non cross-build projects, use releaseStepCommand("publishSigned")
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)