diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 9a3c246..a3a91c0 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -18,6 +18,8 @@ jobs: steps: - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + - name: Test as package + run: swift test - name: CocoaPod Install run: | cd PersonnummerExample diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..042513c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +.swiftpm/ +.build/ \ No newline at end of file diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..97c1fda --- /dev/null +++ b/Package.swift @@ -0,0 +1,23 @@ +// swift-tools-version: 5.6 + +import PackageDescription + +let package = Package( + name: "Personnummer", + products: [ + .library(name: "Personnummer", targets: ["Personnummer"]), + ], + targets: [ + .target( + name: "Personnummer", + dependencies: [], + path: "source" + ), + .testTarget( + name: "PersonnummerTests", + dependencies: ["Personnummer"], + path: "PersonnummerExample/PersonnummerExampleTests", + exclude: ["Info.plist"] + ), + ] +) diff --git a/README.md b/README.md index 6cb60ed..26bc45b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ Small library to validate and format swedish personal identity numbers called "P pod 'Personnummer', '~> 1.0.0' ``` +### Swift Package Manager + +```swift +.package(url: "https://github.com/personnummer/swift.git", from: "1.0.2") +``` + ## Usage ```swift