// swift-tools-version: 6.0 // // Package.swift // gitea-macos-runner // // A single-host daemon for an Apple Silicon Mac that watches a Gitea instance // for queued Actions jobs requiring macOS, runs each in a fresh ephemeral macOS // VM via Apple's Virtualization.framework, then destroys the VM. // // Layout // ------ // * `RunnerCore` — portable, side-effect-light logic (config, Gitea API models // and client, label matching, DHCP lease parsing, SSH transport, and the pure // scheduling state machine). Deliberately free of `import Virtualization` so // it also builds and unit-tests on Linux. // * `RunnerHost` — everything that touches Apple's Virtualization.framework: // VM bundles, image building, guest provisioning, and the orchestrator actor. // macOS-only. // * `gitea-macos-runner` — the CLI/daemon executable. // // SwiftPM auto-globs sources under each target directory; files are never // enumerated here, so parallel workers can add files without touching this file. import PackageDescription let package = Package( name: "gitea-macos-runner", platforms: [ // Virtualization's ASIF disk support (`diskutil image create --format ASIF`) // and the macOS 26 guest tooling are hard requirements. See docs/DESIGN.md. .macOS("26.0") ], products: [ .executable(name: "gitea-macos-runner", targets: ["gitea-macos-runner"]), .library(name: "RunnerCore", targets: ["RunnerCore"]), .library(name: "RunnerHost", targets: ["RunnerHost"]), ], dependencies: [ .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"), .package(url: "https://github.com/apple/swift-log.git", from: "1.6.0"), .package(url: "https://github.com/apple/swift-nio.git", from: "2.76.0"), .package(url: "https://github.com/apple/swift-nio-ssh.git", from: "0.9.0"), ], targets: [ .target( name: "RunnerCore", dependencies: [ .product(name: "Logging", package: "swift-log"), .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOPosix", package: "swift-nio"), .product(name: "NIOSSH", package: "swift-nio-ssh"), ] ), .target( name: "RunnerHost", dependencies: [ "RunnerCore", .product(name: "Logging", package: "swift-log"), ] ), .executableTarget( name: "gitea-macos-runner", dependencies: [ "RunnerCore", "RunnerHost", .product(name: "ArgumentParser", package: "swift-argument-parser"), .product(name: "Logging", package: "swift-log"), ] ), .testTarget( name: "RunnerCoreTests", dependencies: ["RunnerCore"] ), ] )