Swiftlane
Swiftlane contains a set of build utilities to speed up iOS and macOS development and deployment
There’s no additional configuration file, your Swift script file is the source of truth. With auto
completion and type safety, you are ensured to do the right things in Swiftlane.
- Swiftlane and its dependencies are written in pure Swift, making it easy to read and contribute.
- Use latest Swift features like async/await to enable declarative syntax
- Type-safe. All required and optional arguments are clear.
- No configuration file. Your Swift script is your definition.
- Simple wrapper around existing tools like xcodebuild, instruments and agvtool
- Reuse awesome Swift scripting dependencies from Swift community
How to use
Swiftlane is intended to be used as a Swift Package. Please consult Examples
folder for ways to integrate
- CLI: make a macOS Command Line Tool project
- Script: make an executable Swift Package
import Swiftlane
import AppStoreConnect
@main
struct Script {
static func main() async throws {
try await deployMyApp()
}
private static func deployMyApp() async throws {
var workflow = Workflow()
workflow.directory = Settings.fs
.homeDirectory()
.appendingPathComponent("Projects/swiftlane/Examples/MyApp")
workflow.xcodeApp = URL(string: "/Applications/Xcode.app")
let build = Build()
build.project("MyApp")
build.allowProvisioningUpdates()
build.destination(platform: .iOSSimulator, name: "iPhone 13")
build.workflow = workflow
try await build.run()
guard
let issuerId = Settings.env["ASC_ISSUER_ID"],
let privateKeyId = Settings.env["ASC_PRIVATE_KEY_ID"],
let privateKey = Settings.env["ASC_PRIVATE_KEY"]
else { return }
let asc = try ASC(
credential: AppStoreConnect.Credential(
issuerId: issuerId,
privateKeyId: privateKeyId,
privateKey: privateKey
)
)
try await asc.fetchCertificates()
try await asc.fetchProvisioningProfiles()
let keychain = try await Keychain.create(
path: Keychain.Path(
rawValue: Settings.fs
.downloadsDirectory
.appendingPathComponent("custom.keychain")),
password: "keychain_password"
)
try await keychain.unlock()
try await keychain.import(
certificateFile: Settings.fs
.downloadsDirectory
.appendingPathComponent("abcpass.p12"),
certificatePassword: "123"
)
}
}
Actions
iOS
ASC
Project
Keychain
Simulator
Xcode
macOS
Standard
Settings
Configurations via Settings
- Console: log to console
- FileSystem: interact with file system
- Environment: read environment values
- CommandLine: run command line tools
Credit
License
Swiftlane is released under the MIT license. See LICENSE for details.
Swiftlane
Swiftlane contains a set of build utilities to speed up iOS and macOS development and deployment
There’s no additional configuration file, your Swift script file is the source of truth. With auto completion and type safety, you are ensured to do the right things in Swiftlane.
How to use
Swiftlane is intended to be used as a Swift Package. Please consult
Examples
folder for ways to integrateActions
iOS
ASC
Project
Keychain
Simulator
Xcode
macOS
Standard
Settings
Configurations via
Settings
Credit
License
Swiftlane is released under the MIT license. See LICENSE for details.