-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathbuild.sbt
More file actions
145 lines (131 loc) · 4.15 KB
/
build.sbt
File metadata and controls
145 lines (131 loc) · 4.15 KB
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
137
138
139
140
141
142
143
144
145
/*
* Copyright 2020-2021 Daniel Spiewak
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
name := "sbt-github-actions"
lazy val scala212 = "2.12.20"
ThisBuild / organization := "com.github.sbt"
ThisBuild / crossScalaVersions := Seq(scala212)
ThisBuild / scalaVersion := scala212
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest", "macos-latest", "windows-latest")
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(
commands = List("+ test", "+ scripted"),
cond = Some("matrix.java != 'zulu@8'")
),
WorkflowStep.Sbt(
commands = List("test", "scripted"),
cond = Some("matrix.java == 'zulu@8'")
),
)
ThisBuild / githubWorkflowBuildPostamble += WorkflowStep.Run(
commands = List("""rm -rf "$HOME/.ivy2/local""""),
name = Some("Clean up Ivy Local repo")
)
def publishTaskJavaSpec = JavaSpec.corretto("17")
ThisBuild / githubWorkflowJavaVersions := Seq(
// https://github.com/sbt/sbt-github-actions/issues/216
// https://github.com/sbt/sbt-github-actions/blob/6b89abdd5381ef61870b/src/main/scala/sbtghactions/GenerativePlugin.scala#L738
publishTaskJavaSpec,
JavaSpec.graalvm(Graalvm.Distribution("graalvm"), "17"),
JavaSpec.zulu("8"),
)
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches :=
Seq(
RefPredicate.StartsWith(Ref.Tag("v")),
RefPredicate.Equals(Ref.Branch("main"))
)
ThisBuild / 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 }}"
)
)
)
pluginCrossBuild / sbtVersion := {
scalaBinaryVersion.value match {
case "2.12" =>
"1.5.5"
case _ =>
"2.0.0-RC9"
}
}
crossScalaVersions += "3.8.1"
publishMavenStyle := true
scalacOptions +=
"-Xlint:_,-missing-interpolator"
scalacOptions ++= {
scalaBinaryVersion.value match {
case "2.12" =>
Seq("-release:8")
case "3" =>
Nil
}
}
libraryDependencies += "org.specs2" %% "specs2-core" % "4.20.8" % Test
enablePlugins(SbtPlugin)
scriptedLaunchOpts ++= Seq("-Dplugin.version=" + version.value)
scriptedBufferLog := true
// This sbt version is necessary for CI to work on windows with
// scripted tests, see https://github.com/sbt/sbt/pull/7087
scriptedSbt := {
scalaBinaryVersion.value match {
case "2.12" =>
"1.10.2"
case _ =>
scriptedSbt.value
}
}
ThisBuild / homepage := Some(url("https://github.com/sbt/sbt-github-actions"))
ThisBuild / startYear := Some(2020)
ThisBuild / dynverSonatypeSnapshots := true
ThisBuild / developers := List(
Developer(
id = "armanbilge",
name = "Arman Bilge",
email = "@armanbilge",
url = url("https://github.com/armanbilge")
),
Developer(
id = "djspiewak",
name = "Daniel Spiewak",
email = "@djspiewak",
url = url("https://github.com/djspiewak")
),
Developer(
id = "eed3si9n",
name = "Eugene Yokota",
email = "@eed3si9n",
url = url("https://github.com/eed3si9n")
),
Developer(
id = "mdedetrich",
name = "Matthew de Detrich",
email = "mdedetrich@gmail.com",
url = url("https://github.com/mdedetrich")
)
)
ThisBuild / description := "An sbt plugin which makes it easier to build with GitHub Actions"
ThisBuild / licenses := List("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0"))
ThisBuild / pomIncludeRepository := { _ =>
false
}
ThisBuild / publishMavenStyle := true
Global / excludeLintKeys ++= Set(pomIncludeRepository, publishMavenStyle)