Skip to content

Commit 3793b3a

Browse files
authored
Merge pull request #16273 from MinaProtocol/dkijania/remove_publish_job_from_pr
publish debians only on stable pipelines
2 parents 74dc8f9 + 045d683 commit 3793b3a

File tree

2 files changed

+69
-14
lines changed

2 files changed

+69
-14
lines changed

buildkite/src/Command/MinaArtifact.dhall

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ let build_artifacts
105105

106106
let publish_to_debian_repo =
107107
\(spec : MinaBuildSpec.Type)
108+
-> \(dependsOn : List Command.TaggedKey.Type)
108109
-> Command.build
109110
Command.Config::{
110111
, commands =
@@ -122,14 +123,9 @@ let publish_to_debian_repo =
122123
"Publish Mina for ${DebianVersions.capitalName
123124
spec.debVersion} ${Profiles.toSuffixUppercase
124125
spec.profile}"
125-
, key = "publish-deb-pkg"
126-
, depends_on =
127-
DebianVersions.dependsOnStep
128-
(Some spec.prefix)
129-
spec.debVersion
130-
spec.profile
131-
spec.buildFlags
132-
"build"
126+
, key =
127+
"publish-${DebianVersions.lowerName spec.debVersion}-deb-pkg"
128+
, depends_on = dependsOn
133129
, target = Size.Small
134130
}
135131

@@ -318,18 +314,25 @@ let onlyDebianPipeline
318314
= \(spec : MinaBuildSpec.Type)
319315
-> pipelineBuilder
320316
spec
321-
[ build_artifacts spec, publish_to_debian_repo spec ]
317+
[ build_artifacts spec
318+
, publish_to_debian_repo
319+
spec
320+
( DebianVersions.dependsOnStep
321+
(Some spec.prefix)
322+
spec.debVersion
323+
spec.profile
324+
spec.buildFlags
325+
"build"
326+
)
327+
]
322328

323329
let pipeline
324330
: MinaBuildSpec.Type -> Pipeline.Config.Type
325331
= \(spec : MinaBuildSpec.Type)
326-
-> pipelineBuilder
327-
spec
328-
( [ build_artifacts spec, publish_to_debian_repo spec ]
329-
# docker_commands spec
330-
)
332+
-> pipelineBuilder spec ([ build_artifacts spec ] # docker_commands spec)
331333

332334
in { pipeline = pipeline
333335
, onlyDebianPipeline = onlyDebianPipeline
336+
, publishToDebian = publish_to_debian_repo
334337
, MinaBuildSpec = MinaBuildSpec
335338
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
let ArtifactPipelines = ../../Command/MinaArtifact.dhall
2+
3+
let Command = ../../Command/Base.dhall
4+
5+
let Pipeline = ../../Pipeline/Dsl.dhall
6+
7+
let PipelineTag = ../../Pipeline/Tag.dhall
8+
9+
let PipelineMode = ../../Pipeline/Mode.dhall
10+
11+
let DebianChannel = ../../Constants/DebianChannel.dhall
12+
13+
let DebianVersions = ../../Constants/DebianVersions.dhall
14+
15+
let JobSpec = ../../Pipeline/JobSpec.dhall
16+
17+
let name = "PublishDebians"
18+
19+
let dependsOnCodename =
20+
\(codename : DebianVersions.DebVersion)
21+
-> [ { name = name
22+
, key = "publish-${DebianVersions.lowerName codename}-deb-pkg"
23+
}
24+
]
25+
26+
let specBuilder =
27+
\(debVersion : DebianVersions.DebVersion)
28+
-> ArtifactPipelines.MinaBuildSpec::{
29+
, channel = DebianChannel.Type.Unstable
30+
, prefix = name
31+
, debVersion = debVersion
32+
}
33+
34+
in Pipeline.build
35+
Pipeline.Config::{
36+
, spec = JobSpec::{
37+
, dirtyWhen =
38+
DebianVersions.dirtyWhen DebianVersions.DebVersion.Bullseye
39+
, path = "TearDown"
40+
, name = name
41+
, tags = [ PipelineTag.Type.TearDown ]
42+
, mode = PipelineMode.Type.Stable
43+
}
44+
, steps =
45+
[ ArtifactPipelines.publishToDebian
46+
(specBuilder DebianVersions.DebVersion.Bullseye)
47+
([] : List Command.TaggedKey.Type)
48+
, ArtifactPipelines.publishToDebian
49+
(specBuilder DebianVersions.DebVersion.Focal)
50+
(dependsOnCodename DebianVersions.DebVersion.Bullseye)
51+
]
52+
}

0 commit comments

Comments
 (0)