Skip to content

Commit 3fa55ff

Browse files
authored
docs: DocC API docs (#338)
Adds DocC generated API docs, published [here](https://square.github.io/workflow-swift/documentation/), and removes the old doc generation pipeline.
1 parent 4a5b28f commit 3fa55ff

File tree

10 files changed

+85
-171
lines changed

10 files changed

+85
-171
lines changed

.buildscript/build_swift_docs.sh

Lines changed: 0 additions & 45 deletions
This file was deleted.

.buildscript/update_changelog.swift

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/docs.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Generate and publish docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
env:
8+
# Xcode 16.3 gets us Swift 6.1, required for docc merge
9+
XCODE_VERSION: 16.3
10+
11+
jobs:
12+
build:
13+
name: Generate API docs and publish to GitHub pages
14+
# macos-15 is required for Xcode 16.3
15+
runs-on: macos-15
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8
21+
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
22+
with:
23+
xcode-version: ${{ env.XCODE_VERSION }}
24+
25+
- name: Install dependencies
26+
run: tuist install --path Samples
27+
28+
- name: Generate project
29+
run: tuist generate --path Samples --no-open
30+
31+
- name: Generate Docs
32+
run: Scripts/generate_docs.sh
33+
34+
- name: Deploy to GitHub Pages
35+
uses: crazy-max/ghaction-github-pages@df5cc2bfa78282ded844b354faee141f06b41865
36+
with:
37+
target_branch: gh-pages
38+
build_dir: generated_docs
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/swift.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,6 @@ jobs:
6666
- name: Tutorial App
6767
run: tuist test --path Samples/Tutorial TutorialTests
6868

69-
documentation-lint:
70-
runs-on: macos-latest
71-
72-
steps:
73-
- uses: actions/checkout@v4
74-
- uses: jdx/mise-action@v2
75-
76-
- name: Switch Xcode
77-
run: sudo xcode-select -s /Applications/Xcode_${XCODE_VERSION}.app
78-
79-
- name: Install sourcedocs
80-
run: brew install sourcedocs
81-
82-
- name: Swiftdocs
83-
run: |
84-
.buildscript/build_swift_docs.sh ${{ runner.temp }}/swiftdocs
85-
8669
swiftformat:
8770
runs-on: macos-latest
8871

.markdownlint.rb

Lines changed: 0 additions & 45 deletions
This file was deleted.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ let package = Package(
6060
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "7.1.1"),
6161
.package(url: "https://github.com/ReactiveX/RxSwift.git", from: "6.6.0"),
6262
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0" ..< "601.0.0-prerelease"),
63-
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.1.0"),
63+
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.5"),
6464
.package(url: "https://github.com/pointfreeco/swift-identified-collections", from: "1.0.0"),
6565
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.4.0"),
6666
.package(url: "https://github.com/pointfreeco/swift-perception", from: "1.5.0"),

Samples/Tuist/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Samples/Workspace.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ let workspace = Workspace(
2222
.workflow("ViewEnvironment"),
2323
.workflow("ViewEnvironmentUI"),
2424
.workflow("WorkflowSwiftUIExperimental"),
25+
.scheme(
26+
name: "Documentation",
27+
buildAction: .buildAction(
28+
targets: [
29+
.project(path: "..", target: "ViewEnvironment"),
30+
.project(path: "..", target: "ViewEnvironmentUI"),
31+
.project(path: "..", target: "Workflow"),
32+
.project(path: "..", target: "WorkflowSwiftUI"),
33+
.project(path: "..", target: "WorkflowTesting"),
34+
.project(path: "..", target: "WorkflowUI"),
35+
]
36+
)
37+
),
2538
]
2639
)
2740

Scripts/generate_docs.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
BUILD_PATH=docs_build
6+
MERGED_PATH=generated_docs
7+
REPO_NAME=workflow-swift
8+
9+
xcodebuild docbuild \
10+
-scheme Documentation \
11+
-derivedDataPath "$BUILD_PATH" \
12+
-workspace Samples/WorkflowDevelopment.xcworkspace \
13+
-destination generic/platform=iOS \
14+
DOCC_HOSTING_BASE_PATH="$REPO_NAME" \
15+
| xcpretty
16+
17+
find_archive() {
18+
find "$BUILD_PATH" -type d -name "$1.doccarchive" -print -quit
19+
}
20+
21+
xcrun docc merge \
22+
$(find_archive ViewEnvironment) \
23+
$(find_archive ViewEnvironmentUI) \
24+
$(find_archive Workflow) \
25+
$(find_archive WorkflowSwiftUI) \
26+
$(find_archive WorkflowTesting) \
27+
$(find_archive WorkflowUI) \
28+
--output-path "$MERGED_PATH" \
29+
--synthesized-landing-page-name "$REPO_NAME"

lint_docs.sh

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)