Skip to main content

release_tool/
domain.rs

1use crate::tag::CalendarTag;
2
3#[derive(Clone, Copy, Debug, Eq, PartialEq)]
4pub enum ReleaseIntent {
5    Existing,
6    New,
7}
8
9#[derive(Clone, Debug, Eq, PartialEq)]
10pub struct ReleaseCandidate {
11    pub repository: String,
12    pub commit: String,
13    pub tag: CalendarTag,
14    pub intent: ReleaseIntent,
15    pub tag_already_sealed: bool,
16}
17
18#[derive(Clone, Debug, Eq, PartialEq)]
19pub struct SealedRelease {
20    pub release: ReleaseCandidate,
21    pub tag_object: String,
22}
23
24#[derive(Clone, Debug, Eq, Hash, PartialEq)]
25pub enum ArtifactIdentity {
26    GithubReleaseAsset {
27        name: String,
28    },
29    MavenPackage {
30        group_id: String,
31        artifact_id: String,
32        version: String,
33        extension: String,
34    },
35    OciImage {
36        repository: String,
37        tag: String,
38        platform: String,
39    },
40}
41
42#[derive(Clone, Debug, Eq, PartialEq)]
43pub struct TargetPlan {
44    pub name: String,
45    pub publisher: String,
46    pub release: ReleaseCandidate,
47    pub artifacts: Vec<ArtifactIdentity>,
48}
49
50#[derive(Clone, Debug, Eq, PartialEq)]
51pub struct PreparedArtifact {
52    pub identity: ArtifactIdentity,
53    pub path: std::path::PathBuf,
54    pub sha256: String,
55}
56
57#[derive(Clone, Debug, Eq, PartialEq)]
58pub struct ArtifactManifest {
59    pub target: String,
60    pub publisher: String,
61    pub release: ReleaseCandidate,
62    pub artifacts: Vec<PreparedArtifact>,
63}
64
65#[derive(Clone, Debug, Eq, PartialEq)]
66pub struct ReleasePlan {
67    pub tool_version: String,
68    pub release: ReleaseCandidate,
69    pub targets: Vec<TargetPlan>,
70}