Skip to content

Commit 9fff447

Browse files
committed
Tar build output before upload to avoid NTFS filename restrictions
DocC archives contain colons in filenames (e.g. when(configuration:).json) which upload-artifact rejects. Package as a tarball instead. Also add explanatory comment on the git clean step.
1 parent 13ce5ee commit 9fff447

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/build_documentation.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
- name: Build documentation
3333
run: python3 scripts/build_docs.py --output-dir "$GITHUB_WORKSPACE/build-output"
3434

35-
- name: List build output
36-
run: ls -la "$GITHUB_WORKSPACE/build-output"
35+
- name: Package build output
36+
run: tar -czf "$GITHUB_WORKSPACE/combined-documentation.tar.gz" -C "$GITHUB_WORKSPACE/build-output" .
3737

3838
- uses: actions/upload-artifact@v4
3939
with:
4040
name: combined-documentation
41-
path: build-output/
41+
path: combined-documentation.tar.gz

scripts/build_docs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ def clone_or_update(source, workspace, ref):
195195
],
196196
check=True,
197197
)
198+
# Remove untracked files left by previous builds (e.g. swift-book's
199+
# generated SummaryOfTheGrammar.md) so preflight scripts don't fail
200+
# when they detect stale output from a cached workspace.
198201
subprocess.run(
199202
["git", "-C", str(source_dir), "clean", "--quiet", "-fdx"],
200203
check=True,

0 commit comments

Comments
 (0)