Skip to content

Commit

Permalink
Merge pull request #63 from armanbilge/topic/upstream-mk-target-dirs
Browse files Browse the repository at this point in the history
Upstream "Make target directories" step
  • Loading branch information
armanbilge authored Jan 16, 2022
2 parents 70a204b + d9ed9d6 commit 71b4fee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
16 changes: 1 addition & 15 deletions ci/src/main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,7 @@ object TypelevelCiPlugin extends AutoPlugin {
addCommandAlias("ci", mkCommand(ciCommands)) ++ Seq(
githubWorkflowPublishTargetBranches := Seq(),
githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("ci"))),
githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8")),
githubWorkflowGeneratedUploadSteps ~= { steps =>
// hack hack hack until upstreamed
// workaround for https://github.com/djspiewak/sbt-github-actions/pull/66
steps.flatMap {
case compressStep @ WorkflowStep
.Run(command :: _, _, Some("Compress target directories"), _, _, _) =>
val mkdirStep = WorkflowStep.Run(
commands = List(command.replace("tar cf targets.tar", "mkdir -p")),
name = Some("Make target directories")
)
List(mkdirStep, compressStep)
case step => List(step)
}
}
githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"))
)

val ciCommands = List(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
str
}

val mkdir = WorkflowStep.Run(
List(s"mkdir -p ${sanitized.mkString(" ")} project/target"),
name = Some("Make target directories"))

val tar = WorkflowStep.Run(
List(s"tar cf targets.tar ${sanitized.mkString(" ")} project/target"),
name = Some("Compress target directories"))
Expand All @@ -580,7 +584,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
"path" -> "targets.tar")
)

Seq(tar, upload)
Seq(mkdir, tar, upload)
} else {
Seq()
}
Expand Down

0 comments on commit 71b4fee

Please sign in to comment.