forked from austek/pact-avro-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-actions.sbt
85 lines (81 loc) · 2.41 KB
/
github-actions.sbt
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// sbt-github-actions
// Add windows-latest when https://github.com/sbt/sbt/issues/7082 is resolved
// Add macos-latest when step to install docker on it is done
ThisBuild / githubWorkflowOSes := Seq("ubuntu-latest")
ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.zulu("17"),
JavaSpec.zulu("20")
)
ThisBuild / githubWorkflowTargetBranches := Seq("main")
ThisBuild / githubWorkflowTargetTags := Seq("v*")
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Run(
name = Some("Start containers"),
commands = List("docker compose -f docker-compose.yml up -d")
),
WorkflowStep.Sbt(
name = Some("Build project"),
commands = List("compile", "scalafmtCheckAll", "javafmtCheckAll", "plugin/test")
),
WorkflowStep.Sbt(
name = Some("Test Consumer"),
commands = List("consumer/test")
),
WorkflowStep.Run(
name = Some("Upload Consumer Pact"),
commands = List("./scripts/pact-publish.sh")
),
WorkflowStep.Sbt(
name = Some("Test Provider"),
commands = List("provider/test")
),
WorkflowStep.Run(
cond = Some("always()"),
name = Some("Stop containers"),
commands = List("docker compose -f docker-compose.yml down")
)
)
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.StartsWith(Ref.Tag("v"))
)
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Use(
UseRef.Public("actions", "setup-node", "v1"),
name = Some("Doc - Install node"),
params = Map("node-version" -> "16.x")
),
WorkflowStep.Run(
name = Some("Doc - Install dependencies"),
commands = List("npm ci")
),
WorkflowStep.Run(
name = Some("Doc - build"),
commands = List("./scripts/docBuild.sh ${{ github.ref }}")
),
WorkflowStep.Sbt(
name = Some("Build package"),
commands = List("universal:packageZipTarball")
),
WorkflowStep.Run(
name = Some("Prepare Artifacts"),
commands = List("./scripts/prepArtifacts.sh")
),
WorkflowStep.Use(
UseRef.Public("svenstaro", "upload-release-action", "v2"),
name = Some("Upload Release Assets"),
id = Some("upload-release-asset"),
params = Map(
"repo_token" -> "${{ secrets.GITHUB_TOKEN }}",
"file" -> "target/artifacts/*",
"file_glob" -> "true",
"tag" -> "${{ github.ref }}"
)
),
WorkflowStep.Sbt(
name = Some("Publish docs"),
commands = List("publishToGitHubPages"),
env = Map(
"GITHUB_TOKEN" -> "${{ secrets.GITHUB_TOKEN }}"
)
)
)