forked from sbt/sbt-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
28 lines (25 loc) · 853 Bytes
/
build.sbt
File metadata and controls
28 lines (25 loc) · 853 Bytes
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
ThisBuild / scalaVersion := "2.12.19"
ThisBuild / githubWorkflowBuild ++= List(
WorkflowStep.Sbt(List("lots")),
WorkflowStep.Sbt(List("of")),
WorkflowStep.Sbt(List("sbt")),
WorkflowStep.Sbt(List("tasks")),
WorkflowStep.Sbt(List("run")),
WorkflowStep.Sbt(List("as", "separate", "steps")),
WorkflowStep.Sbt(List("using")),
WorkflowStep.Sbt(List("sbtn"))
)
ThisBuild / githubWorkflowUseSbtThinClient := true
TaskKey[Unit]("patchIfSbt2") := {
if (sbtBinaryVersion.value == "2") {
val yml = file(".github/workflows/ci.yml")
val targetPath = IO.relativize(baseDirectory.value, target.value).get.replace(java.io.File.separatorChar, '/')
IO.write(
yml,
IO.read(yml).replace(
"run: tar cf targets.tar target project/target",
s"run: tar cf targets.tar ${targetPath} project/target"
)
)
}
}