Skip to content

Commit 58e29fd

Browse files
committed
Create a Workflow type to capture an entire workflow file.
1 parent e95ee9b commit 58e29fd

File tree

8 files changed

+451
-221
lines changed

8 files changed

+451
-221
lines changed

.github/workflows/clean.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77

88
name: Clean
99

10-
on: push
10+
on:
11+
push
1112

1213
jobs:
1314
delete-artifacts:
1415
name: Delete Artifacts
15-
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
os: [ubuntu-22.04]
19+
runs-on: ${{ matrix.os }}
1620
env:
1721
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1822
steps:

github-actions/src/main/resources/clean.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

github-actions/src/main/scala/org/typelevel/sbt/gha/GenerativeKeys.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ trait GenerativeKeys {
2525
lazy val githubWorkflowCheck = taskKey[Unit](
2626
"Checks to see if the ci.yml and clean.yml files are equivalent to what would be generated and errors if otherwise")
2727

28+
lazy val githubWorkflows = settingKey[Map[String, Workflow]](
29+
"The map of jobs which will make up the generated workflows, with the keys being the workflow file path.")
2830
lazy val githubWorkflowGeneratedCI = settingKey[Seq[WorkflowJob]](
2931
"The sequence of jobs which will make up the generated ci workflow (ci.yml)")
3032
lazy val githubWorkflowGeneratedUploadSteps = settingKey[Seq[WorkflowStep]](
@@ -65,13 +67,17 @@ trait GenerativeKeys {
6567
s"Commands automatically prepended to a WorkflowStep.Sbt (default: ['++ $${{ matrix.scala }}'])")
6668
lazy val githubWorkflowBuild = settingKey[Seq[WorkflowStep]](
6769
"A sequence of workflow steps which compile and test the project (default: [Sbt(List(\"test\"))])")
70+
lazy val githubWorkflowBuildJob =
71+
settingKey[WorkflowJob]("A workflow job which compile and test the project")
6872

6973
lazy val githubWorkflowPublishPreamble = settingKey[Seq[WorkflowStep]](
7074
"A list of steps to insert after base setup but before publishing (default: [])")
7175
lazy val githubWorkflowPublishPostamble = settingKey[Seq[WorkflowStep]](
7276
"A list of steps to insert after publication but before the end of the publish job (default: [])")
7377
lazy val githubWorkflowPublish = settingKey[Seq[WorkflowStep]](
7478
"A sequence workflow steps which publishes the project (default: [Sbt(List(\"+publish\"))])")
79+
lazy val githubWorkflowPublishJob =
80+
settingKey[WorkflowJob]("A workflow job which publishes the project.")
7581
lazy val githubWorkflowPublishTargetBranches = settingKey[Seq[RefPredicate]](
7682
"A set of branch predicates which will be applied to determine whether the current branch gets a publication stage; if empty, publish will be skipped entirely (default: [== main])")
7783
lazy val githubWorkflowPublishCond = settingKey[Option[String]](

0 commit comments

Comments
 (0)