Skip to content

Commit 11ddbcb

Browse files
committed
Build docs in the release workflow so the source zip includes doc-html
The source-zip build moved to CI, which configured out-of-source and never ran the doc target, so the pre-rendered HTML docs (doc-html/) silently dropped out of the package. Install the doc toolchain, build the docs, and stage them into the source tree before package_source so CPack picks them up.
1 parent e8deaf2 commit 11ddbcb

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
# slsa-github-generator. The maintainer reviews the draft (which by then has
55
# both the zip and *.intoto.jsonl attached) and clicks Publish to finalize.
66
#
7+
# The source package includes the pre-rendered HTML documentation (doc-html/),
8+
# so this workflow builds the docs and stages them into the source tree before
9+
# running CPack's package_source target.
10+
#
711
# This makes the provenance attest to the actual build that produced the
812
# artifact, rather than just attesting to a hash observed after the fact.
913
#
@@ -54,10 +58,31 @@ jobs:
5458
ref: ${{ steps.vars.outputs.ref }}
5559
persist-credentials: false
5660

61+
- name: Install the documentation toolchain
62+
# The source zip ships the pre-rendered HTML docs (doc-html/), so the
63+
# docs must be built before packaging. doxygen feeds the API reference;
64+
# mkdocs plus the pinned, hash-verified deps render the site. The venv
65+
# lives outside the checkout so it is not swept into the source zip, and
66+
# is added to PATH so CMake's find_program(MKDOCS) and the doxygen call
67+
# in the mkdocstrings handler both resolve in later steps.
68+
run: |
69+
sudo apt-get update
70+
sudo apt-get install -y doxygen
71+
python3 -m venv "$RUNNER_TEMP/doc-venv"
72+
"$RUNNER_TEMP/doc-venv/bin/pip" install --quiet --upgrade pip
73+
"$RUNNER_TEMP/doc-venv/bin/pip" install --quiet --require-hashes \
74+
-r support/doc-requirements.txt
75+
echo "$RUNNER_TEMP/doc-venv/bin" >> "$GITHUB_PATH"
76+
5777
- name: Build source zip via CPack
5878
id: build
79+
# Configure first so the doc target picks up doxygen/mkdocs, build the
80+
# docs, then stage the generated site into the source tree so the CPack
81+
# source package (which packages the source dir) includes doc-html/.
5982
run: |
6083
cmake -B build .
84+
cmake --build build --target doc
85+
cp -r build/doc-html doc-html
6186
cmake --build build --target package_source
6287
pkg=$(ls build/fmt-*.zip)
6388
test -f "$pkg"

0 commit comments

Comments
 (0)