Skip to content

Commit 1292df1

Browse files
committed
Allow merging single doccarchives
1 parent 307f7a0 commit 1292df1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

.github/workflows/swift-generate-and-publish-docs.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,11 @@ jobs:
211211
env:
212212
OUTPUT_PATH: ${{ inputs.repository }}-combined.doccarchive
213213
run: |
214-
if [ "$(find artifacts -type d -name '*.doccarchive' -print | wc -l)" -gt 1 ]; then
215-
# We could use `xargs -J` in POSIX - but GNU xargs doesn't have -J...
216-
find artifacts -type d -name '*.doccarchive' -print0 \
214+
# We could use `xargs -J` in POSIX - but GNU xargs doesn't have -J...
215+
# The exec mkdir is currently needed when merging a single archive. Otherwise `docc merge` fails.
216+
find artifacts -type d -name '*.doccarchive' -exec mkdir -p '{}/data/tutorials' '{}/data/documentation' \; -print0 \
217217
| xargs --null --no-run-if-empty \
218218
sh -c "'$(which docc || xcrun --find docc)' merge \"\$@\" --output-path '${OUTPUT_PATH}'" sh
219-
else
220-
find artifacts -type d -name '*.doccarchive' -exec cp -R '{}' "$(realpath "${OUTPUT_PATH}")" \;
221-
fi
222219
- name: Package combined docs
223220
env:
224221
REPO_NAME: ${{ inputs.repository }}

0 commit comments

Comments
 (0)