Skip to content

Commit 05c48b1

Browse files
authored
Merge pull request #17697 from MinaProtocol/dkijania/publish_debian_for_master
[Nightly CI Fix] introduce one publish job per branch
2 parents 97ad487 + a34d9ec commit 05c48b1

File tree

3 files changed

+50
-26
lines changed

3 files changed

+50
-26
lines changed

buildkite/src/Command/Packages/Publish.dhall

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ let Spec =
6767
, publish_to_docker_io : Bool
6868
, depends_on : List Command.TaggedKey.Type
6969
, branch : Text
70+
, if : Optional Text
7071
}
7172
, default =
7273
{ artifacts = [] : List Package.Type
@@ -82,6 +83,7 @@ let Spec =
8283
, publish_to_docker_io = False
8384
, verify = True
8485
, branch = ""
86+
, if = None Text
8587
}
8688
}
8789

@@ -198,9 +200,12 @@ let publish
198200
)
199201
]
200202
, label = "Debian Packages Publishing"
201-
, key = "publish-debians"
203+
, key =
204+
"publish-debians-${DebianChannel.lowerName
205+
spec.channel}"
202206
, target = Size.Small
203207
, depends_on = spec.depends_on
208+
, if = spec.if
204209
}
205210
]
206211
# Prelude.List.map
@@ -227,9 +232,13 @@ let publish
227232
)
228233
]
229234
, label = "Docker Packages Publishing"
230-
, key = "publish-dockers-${Natural/show r.index}"
235+
, key =
236+
"publish-dockers-${DebianChannel.lowerName
237+
spec.channel}-${Natural/show
238+
r.index}"
231239
, target = Size.Small
232240
, depends_on = spec.depends_on
241+
, if = spec.if
233242
}
234243
)
235244
indexedAdditionalTags

buildkite/src/Constants/DebianChannel.dhall

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ let Channel
33
= < Unstable
44
| Develop
55
| Compatible
6+
| Master
67
| Itn
78
| Umt
89
| UmtMainnet
@@ -19,6 +20,7 @@ let capitalName =
1920
{ Unstable = "Unstable"
2021
, Develop = "Develop"
2122
, Compatible = "Compatible"
23+
, Master = "Master"
2224
, Itn = "Itn"
2325
, Umt = "Umt"
2426
, UmtMainnet = "UmtMainnet"
@@ -36,6 +38,7 @@ let lowerName =
3638
{ Unstable = "unstable"
3739
, Develop = "develop"
3840
, Compatible = "compatible"
41+
, Master = "master"
3942
, Itn = "itn"
4043
, Umt = "umt"
4144
, UmtMainnet = "umt-mainnet"

buildkite/src/Jobs/Promote/AutoPromoteNightly.dhall

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,36 @@ let targetVersion =
5151
codename}-${DebianChannel.lowerName
5252
channel}"
5353

54+
let specs_for_branch =
55+
\(branch : Text)
56+
-> \(channel : DebianChannel.Type)
57+
-> PublishPackages.Spec::{
58+
, artifacts =
59+
[ Artifacts.Type.Daemon
60+
, Artifacts.Type.Archive
61+
, Artifacts.Type.Rosetta
62+
]
63+
, profile = Profiles.Type.Devnet
64+
, networks = [ Network.Type.Devnet ]
65+
, codenames =
66+
[ DebianVersions.DebVersion.Bullseye
67+
, DebianVersions.DebVersion.Focal
68+
, DebianVersions.DebVersion.Noble
69+
, DebianVersions.DebVersion.Bookworm
70+
]
71+
, debian_repo = DebianRepo.Type.Nightly
72+
, channel = channel
73+
, new_docker_tags = new_tags
74+
, target_version = targetVersion
75+
, publish_to_docker_io = False
76+
, backend = "local"
77+
, verify = True
78+
, branch = "\\\${BUILDKITE_BRANCH}"
79+
, source_version = "\\\${MINA_DEB_VERSION}"
80+
, build_id = "\\\${BUILDKITE_BUILD_ID}"
81+
, if = Some "build.branch == \"${branch}\""
82+
}
83+
5484
in Pipeline.build
5585
Pipeline.Config::{
5686
, spec = JobSpec::{
@@ -60,28 +90,10 @@ in Pipeline.build
6090
, name = "AutoPromoteNightly"
6191
}
6292
, steps =
63-
PublishPackages.publish
64-
PublishPackages.Spec::{
65-
, artifacts =
66-
[ Artifacts.Type.Daemon
67-
, Artifacts.Type.Archive
68-
, Artifacts.Type.Rosetta
69-
]
70-
, profile = Profiles.Type.Devnet
71-
, networks = [ Network.Type.Devnet ]
72-
, codenames =
73-
[ DebianVersions.DebVersion.Bullseye
74-
, DebianVersions.DebVersion.Focal
75-
]
76-
, debian_repo = DebianRepo.Type.Nightly
77-
, channel = DebianChannel.Type.Compatible
78-
, new_docker_tags = new_tags
79-
, target_version = targetVersion
80-
, publish_to_docker_io = False
81-
, backend = "local"
82-
, verify = True
83-
, branch = "\\\${BUILDKITE_BRANCH}"
84-
, source_version = "\\\${MINA_DEB_VERSION}"
85-
, build_id = "\\\${BUILDKITE_BUILD_ID}"
86-
}
93+
PublishPackages.publish
94+
(specs_for_branch "compatible" DebianChannel.Type.Compatible)
95+
# PublishPackages.publish
96+
(specs_for_branch "develop" DebianChannel.Type.Develop)
97+
# PublishPackages.publish
98+
(specs_for_branch "master" DebianChannel.Type.Master)
8799
}

0 commit comments

Comments
 (0)