diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml new file mode 100644 index 0000000..162c38a --- /dev/null +++ b/.gitea/workflows/pr.yml @@ -0,0 +1,18 @@ +name: Build + +on: + pull_request: + +jobs: + build: + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Resolve dependencies + run: make resolve + + - name: Build package + run: make build diff --git a/Keychain/Package.resolved b/Keychain/Package.resolved new file mode 100644 index 0000000..093ca7f --- /dev/null +++ b/Keychain/Package.resolved @@ -0,0 +1,15 @@ +{ + "originHash" : "60d3d428473214be2374da47614464243c913251a95cfad9c1f8331314114aba", + "pins" : [ + { + "identity" : "swiftlintplugins", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SimplyDanny/SwiftLintPlugins", + "state" : { + "revision" : "8a4640d14777685ba8f14e832373160498fbab92", + "version" : "0.63.2" + } + } + ], + "version" : 3 +} diff --git a/Keychain/Package.swift b/Keychain/Package.swift new file mode 100644 index 0000000..d11af61 --- /dev/null +++ b/Keychain/Package.swift @@ -0,0 +1,29 @@ +// swift-tools-version: 6.2 + +import PackageDescription + +let package = Package( + name: "Keychain", + platforms: [ + .macOS(.v12) + ], + products: [ + .library( + name: "Keychain", + targets: [ + "Keychain" + ] + ) + ], + dependencies: [ + .package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.63.2") + ], + targets: [ + .target( + name: "Keychain", + plugins: [ + .plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ) + ] +) diff --git a/Keychain/Sources/Keychain/Keychain.swift b/Keychain/Sources/Keychain/Keychain.swift new file mode 100644 index 0000000..6e3ec69 --- /dev/null +++ b/Keychain/Sources/Keychain/Keychain.swift @@ -0,0 +1,6 @@ +// +// Keychain.swift +// Keychain +// +// Created by Bram Kolkman on 20/02/2026. +// diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..62a6370 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +.PHONY: build resolve clean + +build: + @echo "Building Swift package 'Keychain'" + @swift build --package-path Keychain --scratch-path .build + +resolve: + @echo "Resolving Swift package dependencies..." + @swift package resolve --package-path Keychain --scratch-path .build + +clean: + @echo "Cleaning build artifacts..." + @rm -rf .build Keychain/.swiftpm diff --git a/README.md b/README.md index 34ccfbd..399e1cc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,39 @@ # Keychain -A Swift package for the Keychain \ No newline at end of file +A Swift package for interacting with the Keychain. + +## Requirements + +- macOS 12+ +- Swift 6.2+ + +## Package Structure + +``` +Keychain/ +├── Package.swift +├── Package.resolved +└── Sources/ + └── Keychain/ + └── Keychain.swift +``` + +## Dependencies + +- [SwiftLintPlugins](https://github.com/SimplyDanny/SwiftLintPlugins) (≥ 0.63.2) — enforces Swift style and conventions at build time. + +## Usage + +Add the package to your `Package.swift` dependencies and import `Keychain` in your Swift files. + +## Makefile + +A `Makefile` is provided at the root of the repository to simplify common tasks. + +| Command | Description | +|----------------|------------------------------------------| +| `make build` | Builds the Swift package | +| `make resolve` | Resolves package dependencies | +| `make clean` | Removes build artifacts and `.swiftpm` | + +Build artifacts are placed in `.build/` at the repository root (outside the package directory).