Skip to content

Commit 8102f37

Browse files
mbrandonwp4checo
authored andcommitted
Start using docc plugin (#1463)
* wip * wip * syntax fix * wip * wip Co-authored-by: Stephen Celis <[email protected]> (cherry picked from commit 2c40fe0969a65c734759edb534d5f6e67c1379b2) # Conflicts: # .github/workflows/documentation.yml
1 parent a0b123d commit 8102f37

File tree

1 file changed

+10
-56
lines changed

1 file changed

+10
-56
lines changed

.github/workflows/documentation.yml

Lines changed: 10 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,6 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323

24-
- name: Checkout swift-docc
25-
uses: actions/checkout@v2
26-
with:
27-
repository: apple/swift-docc
28-
ref: main
29-
path: swift-docc
30-
31-
- name: Cache DocC
32-
id: cache-docc
33-
uses: actions/cache@v2
34-
with:
35-
key: swift-url-docc-build
36-
path: swift-docc/.build
37-
38-
- name: Build swift-docc
39-
if: ${{ !steps.cache-docc.outputs.cache-hit }}
40-
run: |
41-
cd swift-docc; swift build --product docc -c release; cd ..
42-
43-
- name: Checkout swift-docc-render
44-
uses: actions/checkout@v2
45-
with:
46-
repository: apple/swift-docc-render
47-
ref: main
48-
path: swift-docc-render
49-
50-
- name: Build swift-docc-render
51-
run: |
52-
cd swift-docc-render; npm install && npm run build; cd ..
53-
5424
- name: Checkout gh-pages Branch
5525
uses: actions/checkout@v2
5626
with:
@@ -65,41 +35,25 @@ jobs:
6535
6636
for tag in $(echo "main"; git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.0" | head -6);
6737
do
68-
if [ -d "docs-out/$tag" ]
38+
if [ -d "docs-out/$tag/data/documentation/composablearchitecture" ]
6939
then
7040
echo "✅ Documentation for "$tag" already exists.";
7141
else
72-
echo "⏳ Generating documentation for "$target" @ "$tag" release.";
42+
echo "⏳ Generating documentation for ComposableArchitecture @ "$tag" release.";
43+
rm -rf "docs-out/$tag";
7344
74-
for target in ComposableArchitecture Dependencies;
75-
do
7645
git checkout .;
7746
git checkout "$tag";
78-
mkdir -p Sources/"$target"/Documentation.docc;
79-
export DOCC_HTML_DIR="$(pwd)/swift-docc-render/dist";
8047
81-
rm -rf .build/symbol-graphs;
82-
mkdir -p .build/symbol-graphs;
83-
swift build \
84-
--target "$target" \
85-
-Xswiftc \
86-
-emit-symbol-graph \
87-
-Xswiftc \
88-
-emit-symbol-graph-dir \
89-
-Xswiftc \
90-
.build/symbol-graphs \
91-
&& swift-docc/.build/release/docc convert Sources/"$target"/Documentation.docc \
92-
--fallback-display-name "$target" \
93-
--fallback-bundle-identifier co.pointfree.ComposableArchitecture \
94-
--fallback-bundle-version 0.0.0 \
95-
--additional-symbol-graph-dir \
96-
.build/symbol-graphs \
48+
swift package \
49+
--allow-writing-to-directory docs-out/"$tag" \
50+
generate-documentation \
51+
--target ComposableArchitecture \
52+
--output-path docs-out/"$tag" \
9753
--transform-for-static-hosting \
9854
--hosting-base-path /reactiveswift-composable-architecture/"$tag" \
99-
--output-path docs-out/"$tag" \
100-
&& echo "✅ Documentation generated for "$target" @ "$tag" release." \
101-
|| echo "⚠️ Documentation skipped for "$target" @ "$tag".";
102-
done;
55+
&& echo "✅ Documentation generated for ComposableArchitecture @ "$tag" release." \
56+
|| echo "⚠️ Documentation skipped for ComposableArchitecture @ "$tag".";
10357
fi;
10458
done
10559

0 commit comments

Comments
 (0)