diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 326b231..c5b8ecc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,15 @@ name: Swift on: [push] jobs: + documentation: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Generate documentation + run: xcodebuild docbuild -scheme AnimationPlanner -derivedDataPath DerivedData -destination 'platform=iOS Simulator,name=iPhone 13' + - name: Process documentation + run: $(xcrun --find docc) process-archive transform-for-static-hosting DerivedData/Build/Products/Debug-iphonesimulator/AnimationPlanner.doccarchive --output-path ./docs --hosting-base-path AnimationPlanner + build: runs-on: macos-latest steps: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..53bad6b --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,7 @@ +- uses: fwcd/swift-docc-action@v1 + with: + target: AnimationPlanner + output: ./docs + hosting-base-path: AnimationPlanner + disable-indexing: 'true' + transform-for-static-hosting: 'true' diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..3b6d58b --- /dev/null +++ b/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "SwiftDocCPlugin", + "repositoryURL": "https://github.com/apple/swift-docc-plugin", + "state": { + "branch": null, + "revision": "3303b164430d9a7055ba484c8ead67a52f7b74f6", + "version": "1.0.0" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift index 0e3cb6a..75734e3 100644 --- a/Package.swift +++ b/Package.swift @@ -22,3 +22,9 @@ let package = Package( dependencies: ["AnimationPlanner"]), ] ) +#if swift(>=5.6) + // Add the documentation compiler plugin if possible + package.dependencies.append( + .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0") + ) +#endif