Skip to content

Commit e221cbe

Browse files
committed
Fix documentation generation with Xcode 15.2
1 parent 2af6534 commit e221cbe

File tree

1 file changed

+19
-53
lines changed

1 file changed

+19
-53
lines changed

.github/workflows/documentation.yml

Lines changed: 19 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,16 @@ jobs:
1515
build:
1616
runs-on: macos-13
1717
steps:
18-
- name: Checkout Package
19-
uses: actions/checkout@v2
18+
- name : Setup Xcode
19+
uses: maxim-lobanov/setup-xcode@v1
2020
with:
21-
fetch-depth: 0
21+
xcode-version: 15.2
2222

23-
- name: Checkout swift-docc
23+
- name: Checkout Package
2424
uses: actions/checkout@v2
2525
with:
26-
repository: apple/swift-docc
27-
ref: main
28-
path: swift-docc
29-
- name: Cache DocC
30-
id: cache-docc
31-
uses: actions/cache@v2
32-
with:
33-
key: swift-url-docc-build
34-
path: swift-docc/.build
35-
- name: Build swift-docc
36-
if: ${{ !steps.cache-docc.outputs.cache-hit }}
37-
run: |
38-
cd swift-docc; swift build --product docc -c release; cd ..
26+
fetch-depth: 0
3927

40-
4128
- name: Checkout gh-pages Branch
4229
uses: actions/checkout@v2
4330
with:
@@ -51,45 +38,24 @@ jobs:
5138
5239
for tag in $(echo "main"; git tag);
5340
do
54-
echo "⏳ Generating documentation for "$tag" release.";
41+
echo "⏳ Generating documentation for "$tag" release.";
5542
56-
if [ -d "docs-out/$tag" ]
57-
then
58-
echo "✅ Documentation for "$tag" already exists.";
59-
else
60-
git checkout "$tag";
61-
export DOCC_HTML_DIR="$(dirname $(xcrun --find docc))/../share/docc/render";
43+
if [ -d "docs-out/$tag" ]
44+
then
45+
echo "✅ Documentation for "$tag" already exists.";
46+
else
47+
git checkout "$tag";
6248
63-
rm -rf .build;
64-
mkdir -p .build/symbol-graphs;
65-
mkdir -p .build/swift-docc-symbol-graphs;
49+
rm -rf .build;
6650
67-
swift build --target UIEnvironment \
68-
-Xswiftc "-sdk" \
69-
-Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \
70-
-Xswiftc "-target" \
71-
-Xswiftc "arm64-apple-ios15.4-simulator" \-Xswiftc -emit-symbol-graph \
72-
-Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs;
73-
74-
if [ -z "$(ls -A .build/symbol-graphs)" ]; then
75-
echo "⚠️ Documentation skipped for "$tag". No symbol graphs.";
76-
else
77-
mv .build/symbol-graphs/UIEnvironment* .build/swift-docc-symbol-graphs;
78-
7951
mkdir -p "docs-out/$tag";
80-
81-
swift-docc/.build/release/docc convert Sources/UIEnvironment/Documentation.docc \
82-
--fallback-display-name UIEnvironment \
83-
--fallback-bundle-identifier com.plum.UIEnvironment \
84-
--fallback-bundle-version 1.0.0 \
85-
--additional-symbol-graph-dir .build/swift-docc-symbol-graphs \
86-
--transform-for-static-hosting \
87-
--hosting-base-path /UIEnvironment/"$tag" \
88-
--output-path docs-out/"$tag" \
89-
&& echo "✅ Documentation generated for "$tag" release." \
90-
|| echo "⚠️ Documentation skipped for "$tag".";
91-
fi
92-
fi;
52+
53+
xcodebuild docbuild -scheme UIEnvironment \
54+
-destination generic/platform=iOS \
55+
OTHER_DOCC_FLAGS="--transform-for-static-hosting --output-path docs-out/$tag --hosting-base-path /UIEnvironment/$tag" \
56+
&& echo "✅ Documentation generated for "$tag" release." \
57+
|| echo "⚠️ Documentation skipped for "$tag".";
58+
fi;
9359
done
9460
9561
- name: Fix permissions

0 commit comments

Comments
 (0)