diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 773892fc..d694d96c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,9 +76,9 @@ jobs: - name: Build source zip via CPack id: build - # Configure first so the doc target picks up doxygen/mkdocs, build the - # docs, then stage the generated site into the source tree so the CPack - # source package (which packages the source dir) includes doc-html/. + # Build the docs and stage the rendered site at the top level so the + # CPack source package includes doc-html/. The build/ tree itself is + # excluded by CPACK_SOURCE_IGNORE_FILES. run: | cmake -B build . cmake --build build --target doc diff --git a/CMakeLists.txt b/CMakeLists.txt index 1045f3ee..ee568cec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -582,7 +582,9 @@ if (FMT_MASTER_PROJECT AND EXISTS ${gitignore}) string(REPLACE "*" ".*" line "${line}") set(ignored_files ${ignored_files} "${line}$" "${line}/") endforeach () - set(ignored_files ${ignored_files} /.git /build/doxyxml .vagrant) + # Exclude the whole build tree: the .gitignore-derived `build/` pattern does + # not actually prune the directory or its contents from the source package. + set(ignored_files ${ignored_files} /.git "/build($|/)" .vagrant) set(CPACK_SOURCE_GENERATOR ZIP) set(CPACK_SOURCE_IGNORE_FILES ${ignored_files})