-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
136 lines (132 loc) · 4.2 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
124
125
126
127
128
129
130
131
132
133
134
135
136
ThisBuild / scalaVersion := "3.1.0"
// publishing info
inThisBuild(
Seq(
organization := "lgbt.princess",
versionScheme := Some("early-semver"),
homepage := Some(url("https://github.com/NthPortal/spaghetti")),
licenses := Seq("The Apache License, Version 2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt")),
developers := List(
Developer(
"NthPortal",
"April | Princess",
"dev@princess.lgbt",
url("https://nthportal.com"),
)
),
scmInfo := Some(
ScmInfo(
url("https://github.com/NthPortal/spaghetti"),
"scm:git:git@github.com:NthPortal/spaghetti.git",
"scm:git:git@github.com:NthPortal/spaghetti.git",
)
),
)
)
// CI config
val PrimaryJava = "adopt@1.8"
inThisBuild(
Seq(
githubWorkflowTargetTags ++= Seq("v*"),
githubWorkflowPublishTargetBranches ++= Seq(
RefPredicate.StartsWith(Ref.Tag("v"))
),
githubWorkflowJavaVersions := Seq(
"adopt@1.8",
"adopt@1.11",
"adopt@1.15",
"graalvm-ce-java8@20.2.0",
),
githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("compile", "test:compile"), name = Some("Compile"))
),
githubWorkflowAddedJobs ++= Seq(
WorkflowJob(
"test",
"Test",
githubWorkflowJobSetup.value.toList ::: List(
WorkflowStep.Sbt(List("test"), name = Some("Test"))
),
javas = githubWorkflowJavaVersions.value.toList,
scalas = crossScalaVersions.value.toList,
needs = List("build"),
matrixFailFast = Some(false),
),
WorkflowJob(
"bincompat",
"Binary Compatibility",
githubWorkflowJobSetup.value.toList ::: List(
WorkflowStep.Sbt(List("clean", "mimaReportBinaryIssues"), name = Some("MiMa"))
),
javas = List(PrimaryJava),
scalas = crossScalaVersions.value.toList,
needs = List("build"),
matrixFailFast = Some(false),
),
// WorkflowJob(
// "coverage",
// "Coverage",
// githubWorkflowJobSetup.value.toList ::: List(
// WorkflowStep.Sbt(
// List("coverage", "test", "coverageAggregate", "coveralls"),
// name = Some("Coveralls"),
// cond = Some("env.COVERALLS_REPO_TOKEN != ''"),
// )
// ),
// env = Map("COVERALLS_REPO_TOKEN" -> "${{ secrets.COVERALLS_REPO_TOKEN }}"),
// javas = List(PrimaryJava),
// scalas = crossScalaVersions.value.toList,
// needs = List("test"),
// matrixFailFast = Some(false),
// ),
WorkflowJob(
"formatting",
"Formatting",
githubWorkflowJobSetup.value.toList ::: List(
WorkflowStep.Sbt(List("scalafmtCheckAll", "scalafmtSbtCheck"), name = Some("Formatting"))
),
javas = List(PrimaryJava),
scalas = List(scalaVersion.value),
needs = List("build"),
matrixFailFast = Some(false),
),
WorkflowJob(
"check-docs",
"Check Docs",
githubWorkflowJobSetup.value.toList ::: List(
WorkflowStep.Sbt(List("doc"), name = Some("Check Scaladocs"))
),
javas = List(PrimaryJava),
scalas = List(scalaVersion.value),
needs = List("build"),
matrixFailFast = Some(false),
),
),
githubWorkflowPublishPreamble += WorkflowStep.Use(UseRef.Public("olafurpg", "setup-gpg", "v3")),
githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}",
),
)
),
)
)
lazy val root = project
.in(file("."))
.settings(
name := "spaghetti",
mimaPreviousArtifacts := Set().map(organization.value %% name.value % _),
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % "test",
scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-new-syntax",
"-unchecked",
"-Werror",
),
)