Skip to content

Commit

Permalink
Fix documentation generation with Xcode 15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nonameplum committed May 25, 2024
1 parent 2af6534 commit e221cbe
Showing 1 changed file with 19 additions and 53 deletions.
72 changes: 19 additions & 53 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,16 @@ jobs:
build:
runs-on: macos-13
steps:
- name: Checkout Package
uses: actions/checkout@v2
- name : Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
fetch-depth: 0
xcode-version: 15.2

- name: Checkout swift-docc
- name: Checkout Package
uses: actions/checkout@v2
with:
repository: apple/swift-docc
ref: main
path: swift-docc
- name: Cache DocC
id: cache-docc
uses: actions/cache@v2
with:
key: swift-url-docc-build
path: swift-docc/.build
- name: Build swift-docc
if: ${{ !steps.cache-docc.outputs.cache-hit }}
run: |
cd swift-docc; swift build --product docc -c release; cd ..
fetch-depth: 0

- name: Checkout gh-pages Branch
uses: actions/checkout@v2
with:
Expand All @@ -51,45 +38,24 @@ jobs:
for tag in $(echo "main"; git tag);
do
echo "⏳ Generating documentation for "$tag" release.";
echo "⏳ Generating documentation for "$tag" release.";
if [ -d "docs-out/$tag" ]
then
echo "✅ Documentation for "$tag" already exists.";
else
git checkout "$tag";
export DOCC_HTML_DIR="$(dirname $(xcrun --find docc))/../share/docc/render";
if [ -d "docs-out/$tag" ]
then
echo "✅ Documentation for "$tag" already exists.";
else
git checkout "$tag";
rm -rf .build;
mkdir -p .build/symbol-graphs;
mkdir -p .build/swift-docc-symbol-graphs;
rm -rf .build;
swift build --target UIEnvironment \
-Xswiftc "-sdk" \
-Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \
-Xswiftc "-target" \
-Xswiftc "arm64-apple-ios15.4-simulator" \-Xswiftc -emit-symbol-graph \
-Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs;
if [ -z "$(ls -A .build/symbol-graphs)" ]; then
echo "⚠️ Documentation skipped for "$tag". No symbol graphs.";
else
mv .build/symbol-graphs/UIEnvironment* .build/swift-docc-symbol-graphs;
mkdir -p "docs-out/$tag";

swift-docc/.build/release/docc convert Sources/UIEnvironment/Documentation.docc \
--fallback-display-name UIEnvironment \
--fallback-bundle-identifier com.plum.UIEnvironment \
--fallback-bundle-version 1.0.0 \
--additional-symbol-graph-dir .build/swift-docc-symbol-graphs \
--transform-for-static-hosting \
--hosting-base-path /UIEnvironment/"$tag" \
--output-path docs-out/"$tag" \
&& echo "✅ Documentation generated for "$tag" release." \
|| echo "⚠️ Documentation skipped for "$tag".";
fi
fi;
xcodebuild docbuild -scheme UIEnvironment \
-destination generic/platform=iOS \
OTHER_DOCC_FLAGS="--transform-for-static-hosting --output-path docs-out/$tag --hosting-base-path /UIEnvironment/$tag" \
&& echo "✅ Documentation generated for "$tag" release." \
|| echo "⚠️ Documentation skipped for "$tag".";
fi;
done
- name: Fix permissions
Expand Down

0 comments on commit e221cbe

Please sign in to comment.