|
4 | 4 | # slsa-github-generator. The maintainer reviews the draft (which by then has |
5 | 5 | # both the zip and *.intoto.jsonl attached) and clicks Publish to finalize. |
6 | 6 | # |
| 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 | +# |
7 | 11 | # This makes the provenance attest to the actual build that produced the |
8 | 12 | # artifact, rather than just attesting to a hash observed after the fact. |
9 | 13 | # |
@@ -54,10 +58,31 @@ jobs: |
54 | 58 | ref: ${{ steps.vars.outputs.ref }} |
55 | 59 | persist-credentials: false |
56 | 60 |
|
| 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 | +
|
57 | 77 | - name: Build source zip via CPack |
58 | 78 | 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/. |
59 | 82 | run: | |
60 | 83 | cmake -B build . |
| 84 | + cmake --build build --target doc |
| 85 | + cp -r build/doc-html doc-html |
61 | 86 | cmake --build build --target package_source |
62 | 87 | pkg=$(ls build/fmt-*.zip) |
63 | 88 | test -f "$pkg" |
|
0 commit comments