refactor: Replace shell script with Swift CLI for artifact bundling

This commit is contained in:
Shibo Lyu 2025-10-05 15:39:43 +08:00
parent dca866c3a9
commit 5a3c64f599
7 changed files with 386 additions and 107 deletions

View file

@ -0,0 +1,53 @@
import Foundation
// MARK: - Artifact Bundle Info Models
/// Represents the info.json file structure for an artifact bundle
struct ArtifactBundleInfo: Codable {
let schemaVersion: String
let artifacts: [String: Artifact]
enum CodingKeys: String, CodingKey {
case schemaVersion, artifacts
}
}
struct Artifact: Codable {
let version: String
let type: String
let variants: [ArtifactVariant]
}
struct ArtifactVariant: Codable {
let path: String
let supportedTriples: [String]
}
// MARK: - Artifact Bundle Index Models
/// Represents the .artifactbundleindex file structure
struct ArtifactBundleIndex: Codable {
let schemaVersion: String
let bundles: [Bundle]
}
struct Bundle: Codable {
let fileName: String
let checksum: String
let supportedTriples: [String]
}
// MARK: - Internal Data Models
/// Configuration for a binary platform
struct BinaryConfiguration {
let binaryName: String
let triple: String
}
/// Information about a created bundle
struct BundleInfo {
let fileName: String
let checksum: String
let triple: String
}