From 8e18b2839e6d7524baece8b23214577c5822121d Mon Sep 17 00:00:00 2001 From: Pim Date: Sat, 25 Jun 2022 12:58:35 +0200 Subject: [PATCH 1/5] Create documentation.yml --- .github/workflows/documentation.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/workflows/documentation.yml 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' From 5e53592e30a79cfb510cfc2f243906717a554efa Mon Sep 17 00:00:00 2001 From: Pim Date: Sat, 25 Jun 2022 13:13:26 +0200 Subject: [PATCH 2/5] Update build.yml --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 326b231..a7164d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,17 @@ name: Swift on: [push] jobs: + documentation: + runs-on: macos-latest + steps: + - uses: fwcd/swift-docc-action@v1 + with: + target: AnimationPlanner + output: ./docs + hosting-base-path: AnimationPlanner + disable-indexing: 'true' + transform-for-static-hosting: 'true' + build: runs-on: macos-latest steps: From ed8e698fcada0aea39d41bbe4f53d2bbe7a8ac45 Mon Sep 17 00:00:00 2001 From: Pim Date: Sat, 25 Jun 2022 13:42:15 +0200 Subject: [PATCH 3/5] Run documentation manually --- .github/workflows/build.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7164d5..ed4d9f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,13 +5,10 @@ jobs: documentation: runs-on: macos-latest steps: - - uses: fwcd/swift-docc-action@v1 - with: - target: AnimationPlanner - output: ./docs - hosting-base-path: AnimationPlanner - disable-indexing: 'true' - transform-for-static-hosting: 'true' + - 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 From 62347f2c3a43f941172c50a4fb46b6ae535e3e92 Mon Sep 17 00:00:00 2001 From: Pim Date: Sat, 25 Jun 2022 13:43:58 +0200 Subject: [PATCH 4/5] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed4d9f8..c5b8ecc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,7 @@ 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 From ed841651beaea6eccb4f887707c101acc96cf789 Mon Sep 17 00:00:00 2001 From: Pim Date: Sat, 25 Jun 2022 16:30:14 +0200 Subject: [PATCH 5/5] Trying with docc dependency added again --- Package.resolved | 16 ++++++++++++++++ Package.swift | 6 ++++++ 2 files changed, 22 insertions(+) create mode 100644 Package.resolved 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