-
Notifications
You must be signed in to change notification settings - Fork 35
/
publish.sbt
66 lines (63 loc) · 2.45 KB
/
publish.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
val repo = new {
val org = "sbt"
val name = "sbt-paradox-material-theme"
val path = org + "/" + name
}
def versionFmt(out: sbtdynver.GitDescribeOutput): String = {
val snapshotSuffix =
if (out.isSnapshot()) "-SNAPSHOT"
else ""
out.ref.dropPrefix + snapshotSuffix
}
def fallbackVersion(d: java.util.Date): String = s"HEAD-${sbtdynver.DynVer timestamp d}"
inThisBuild(
Def.settings(
organization := "com.github.sbt",
licenses += "MIT" -> url("https://github.com/sbt/sbt-paradox-material-theme/blob/master/LICENSE"),
homepage := Some(url(s"https://${repo.org}.github.io/${repo.name}")),
scmInfo := Some(
ScmInfo(
url(s"https://github.com/${repo.path}"),
s"scm:git:[email protected]:${repo.path}.git"
)
),
developers := List(
Developer("jonas", "Jonas Fonseca", "[email protected]", url("https://github.com/jonas")),
Developer(
"sbt-paradox-material-theme",
"Sbt Paradox Material Theme Contributors",
"",
url("https://github.com/sbt/sbt-multi-jvm/graphs/contributors")
)
),
dynverSonatypeSnapshots := true,
git.useGitDescribe := true,
git.remoteRepo := s"[email protected]:${repo.path}.git",
// So that publishLocal doesn't continuously create new versions
version := dynverGitDescribeOutput.value.mkVersion(versionFmt, fallbackVersion(dynverCurrentDate.value)),
dynver := {
val d = new java.util.Date
sbtdynver.DynVer.getGitDescribeOutput(d).mkVersion(versionFmt, fallbackVersion(d))
},
githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "sbt-paradox-material-theme/scripted", "makeSite"))),
githubWorkflowTargetTags ++= Seq("v*"),
githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))),
githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
commands = List("ci-release"),
name = Some("Publish project"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
),
githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest", "windows-latest"),
githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("8")
),
githubWorkflowBuildMatrixExclusions += MatrixExclude(Map("java" -> "temurin@8", "os" -> "macos-latest"))
)
)