diff options
| author | Christian Cleberg <[email protected]> | 2026-04-12 21:17:24 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-12 21:17:24 -0500 |
| commit | 7548bfb595d853c682653c0dc21bb3bf17af80d5 (patch) | |
| tree | d5bc8ac6e70a1666439fb551459f3b36d8a566b3 /Hutch/Models | |
| parent | d89f2d52b623aad98df687865b263adeee7f5de9 (diff) | |
| download | hutch-7548bfb595d853c682653c0dc21bb3bf17af80d5.tar.gz hutch-7548bfb595d853c682653c0dc21bb3bf17af80d5.tar.bz2 hutch-7548bfb595d853c682653c0dc21bb3bf17af80d5.zip | |
feat: add build artifact listing
Implements: https://todo.sr.ht/~ccleberg/hutch/31
Diffstat (limited to 'Hutch/Models')
| -rw-r--r-- | Hutch/Models/Builds.swift | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Hutch/Models/Builds.swift b/Hutch/Models/Builds.swift index 8de4235..d666398 100644 --- a/Hutch/Models/Builds.swift +++ b/Hutch/Models/Builds.swift @@ -122,10 +122,29 @@ struct JobDetail: Codable, Sendable, Equatable { let image: String? let manifest: String? var tasks: [BuildTask] + let artifacts: [BuildArtifact] let log: BuildLog? let owner: Entity } +/// A downloadable artifact emitted by a build job. +struct BuildArtifact: Codable, Sendable, Identifiable, Equatable { + let id: Int + let created: Date + let path: String + let size: Int + let url: URL? + + var filename: String { + let pathComponents = path.split(separator: "/") + return pathComponents.last.map(String.init) ?? path + } + + var isDownloadable: Bool { + url != nil + } +} + /// The log associated with a build job. struct BuildLog: Codable, Sendable, Equatable { let fullURL: String |
