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
25 lines (20 loc) · 781 Bytes
/
build.sbt
File metadata and controls
25 lines (20 loc) · 781 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
organization := "com.github.sbt"
version := "0.0.1"
ThisBuild / crossScalaVersions := Seq("2.13.10", "2.12.17")
ThisBuild / scalaVersion := crossScalaVersions.value.head
ThisBuild / githubWorkflowScalaVersions -= "2.12.17"
ThisBuild / githubWorkflowTargetTags += "v*"
ThisBuild / githubWorkflowPublishTargetBranches += RefPredicate.Equals(Ref.Tag("test"))
TaskKey[Unit]("patchIfSbt2") := {
if (sbtBinaryVersion.value == "2") {
val yml = file("expected-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"
)
)
}
}