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
20 lines (18 loc) · 657 Bytes
/
build.sbt
File metadata and controls
20 lines (18 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
organization := "com.github.sbt"
version := "0.0.1"
ThisBuild / crossScalaVersions := Seq("2.13.10", "2.12.17")
ThisBuild / scalaVersion := crossScalaVersions.value.head
ThisBuild / githubWorkflowOSes := Seq("windows-latest")
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"
)
)
}
}