Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ and rejects an invalid capture. Keep submodules under `lib/` and enable

An accepted upload queues analysis; results appear after Coverity processes it.

`docs-site.yml` builds the HTML and PDF manual with the shared
`wolfSSL/documentation` tooling for documentation pull requests and merges to
`main`. It includes every page in `mkdocs.yml`, including the generated port
registry and board guides, and uploads the `wolftrust-manual` review artifact.
After the companion documentation integration and website upload are enabled,
the nightly documentation update will read merged pages from wolfTrust `main`.
See [DOCS-BUILD.md](../../DOCS-BUILD.md).

## At a glance

| Tier | Trigger | Purpose |
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/docs-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build manual with documentation tooling

on:
pull_request:
paths:
- 'README.md'
- 'AGENTS.md'
- 'docs/**'
- 'DOCS-BUILD.md'
- 'mkdocs.yml'
- 'tools/docs_manual.py'
- 'tools/docs-manual/**'
- 'docker/docs/**'
- '.github/workflows/docs-site.yml'
push:
branches: [main]
paths:
- 'README.md'
- 'AGENTS.md'
- 'docs/**'
- 'DOCS-BUILD.md'
- 'mkdocs.yml'
- 'tools/docs_manual.py'
- 'tools/docs-manual/**'
- 'docker/docs/**'
- '.github/workflows/docs-site.yml'
workflow_dispatch:

permissions:
contents: read
packages: read

jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Select documentation revision
id: documentation
run: echo "sha=$(cat tools/docs-manual/documentation-rev)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
repository: wolfSSL/documentation
ref: ${{ steps.documentation.outputs.sha }}
path: build/documentation
submodules: recursive
persist-credentials: false
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull documentation builder
run: |
set -euo pipefail
image_sha=$(sha256sum docker/docs/Dockerfile docker/docs/requirements.txt | sha256sum | cut -c1-16)
image="ghcr.io/wolfssl/wolftrust-docs:sha-$image_sha"
if ! docker pull "$image"; then
docker build --pull -t "$image" docker/docs
fi
echo "DOCS_IMAGE=$image" >> "$GITHUB_ENV"
- name: Build and validate HTML and PDF
run: |
tools/check-docs-no-internal-links.sh
docker run --rm --user "$(id -u):$(id -g)" --env HOME=/tmp \
--mount "type=bind,source=$GITHUB_WORKSPACE,target=/work/wolfTrust" \
--workdir /work/wolfTrust "$DOCS_IMAGE" \
sh -ec '
python3 tools/docs_manual.py build \
--documentation-root /work/wolfTrust/build/documentation \
--source-root /work/wolfTrust --target all
cd build/documentation/wolfTrust
mkdocs build --strict -f mkdocs.yml
'
test -s build/documentation/wolfTrust/html/index.html
test -s build/documentation/wolfTrust/wolfTrust-Manual.pdf
- uses: actions/upload-artifact@v4
with:
name: wolftrust-manual
path: |
build/documentation/wolfTrust/html/
build/documentation/wolfTrust/wolfTrust-Manual.pdf
if-no-files-found: error
retention-days: 14
42 changes: 42 additions & 0 deletions .github/workflows/publish-docs-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish documentation image

on:
push:
branches: [main]
paths:
- 'docker/docs/**'
- '.github/workflows/publish-docs-image.yml'
workflow_dispatch:

permissions:
contents: read
packages: write

concurrency:
group: publish-wolftrust-docs-image
cancel-in-progress: false

jobs:
publish:
if: github.repository == 'wolfSSL/wolfTrust'
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Select image tag
id: image
run: |
image_sha=$(sha256sum docker/docs/Dockerfile docker/docs/requirements.txt | sha256sum | cut -c1-16)
echo "tag=ghcr.io/wolfssl/wolftrust-docs:sha-$image_sha" >> "$GITHUB_OUTPUT"
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: docker/docs
file: docker/docs/Dockerfile
push: true
tags: ${{ steps.image.outputs.tag }}
26 changes: 0 additions & 26 deletions .github/workflows/wiki-sync.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
url = https://github.com/wolfSSL/wolfHSM.git
[submodule "lib/wolfSSL"]
path = lib/wolfSSL
url = git@github.com:wolfSSL/wolfSSL.git
url = https://github.com/wolfSSL/wolfSSL.git
[submodule "lib/wolfhal"]
path = lib/wolfhal
url = git@github.com:wolfSSL/wolfhal.git
url = https://github.com/wolfSSL/wolfhal.git
[submodule "lib/wolfPSA"]
path = lib/wolfPSA
url = https://github.com/wolfSSL/wolfPSA.git
[submodule "lib/wolfIP"]
path = lib/wolfIP
url = git@github.com:wolfSSL/wolfip.git
url = https://github.com/wolfSSL/wolfip.git
[submodule "lib/wolfCOSE"]
path = lib/wolfCOSE
url = https://github.com/wolfSSL/wolfCOSE.git
[submodule "lib/wolfPKCS11"]
path = lib/wolfPKCS11
url = git@github.com:wolfSSL/wolfPKCS11.git
url = https://github.com/wolfSSL/wolfPKCS11.git
[submodule "lib/wolfTPM"]
path = lib/wolfTPM
url = git@github.com:wolfSSL/wolfTPM.git
url = https://github.com/wolfSSL/wolfTPM.git
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ instructions, and take precedence over this file.
| `tests/firmware/` | the guest images |
| `tools/` | manifest generation, layout checks, guards, the new-port scaffold |
| `lib/` | submodules: wolfSSL, wolfHSM, wolfPSA, wolfCOSE, wolfHAL, wolfIP |
| `docs/` | the published wiki pages |
| `docs/` | the version-controlled manual source, with navigation in `mkdocs.yml` |

[docs/Project-Structure.md](docs/Project-Structure.md) has the full map.

## Build

Needs GNU Make, Python 3, the `arm-none-eabi-` toolchain, a native C compiler
for host tests, and the submodules. Some submodule URLs use GitHub SSH.
for host tests, and the submodules. Submodule URLs use public HTTPS.

```sh
git submodule update --init --recursive
Expand Down Expand Up @@ -73,7 +73,7 @@ targets report a skip, never a pass, without their emulator or board. See
workflows) makes it in the same PR and says why in the description.
- `docs/Ports.md` and the bug report's target list are generated: run
`python3 tools/gen-port-docs.py`, never edit them by hand.
- `docs/` is published to the wiki: `tools/check-docs-no-internal-links.sh`
- `docs/` is published as the manual: `tools/check-docs-no-internal-links.sh`
refuses internal ledgers and developer paths.
- Evidence is kept apart: a compile is not a test, a skip is not a pass, and
emulator results are never hardware results.
Expand Down
97 changes: 97 additions & 0 deletions DOCS-BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Building and publishing the wolfTrust manual

`docs/` is the manual source. `mkdocs.yml` defines the page order and
navigation. The adapter in `tools/docs_manual.py` passes those pages to the
shared MkDocs theme and Pandoc/LaTeX PDF rules in
[`wolfSSL/documentation`](https://github.com/wolfSSL/documentation). Keep manual
content and its navigation in wolfTrust; generated files stay under `build/`.

Keep documentation links in `README.md` pointed at the source pages under
`docs/`. Within the manual, use relative links to other manual pages so the
same source works on GitHub and in generated HTML and PDF. Link source files
outside `docs/` to their location in the wolfTrust GitHub repository.

Every top-level Markdown page in `docs/` must appear exactly once in
`mkdocs.yml`. Add new guides and other pages to the README and manual index
too. The adapter refuses missing or duplicate navigation entries; strict
MkDocs builds check the generated HTML links, and PDF preparation checks
manual heading references. The PDF layout reserves wider number columns
for multi-digit subsection labels and limits image height to leave room for
captions above the footer.

## Local build

Clone the documentation build tools at the revision used by wolfTrust CI:

```sh
git clone https://github.com/wolfSSL/documentation.git build/documentation
git -C build/documentation checkout --detach "$(cat tools/docs-manual/documentation-rev)"
git -C build/documentation submodule update --init --recursive
docker build --pull -t wolftrust-docs:local docker/docs
docker run --rm --user "$(id -u):$(id -g)" --env HOME=/tmp \
--mount "type=bind,source=$PWD,target=/work/wolfTrust" \
--workdir /work/wolfTrust wolftrust-docs:local \
python3 tools/docs_manual.py build \
--documentation-root /work/wolfTrust/build/documentation \
--source-root /work/wolfTrust --target all
```

The outputs are `build/documentation/wolfTrust/html/` and
`build/documentation/wolfTrust/wolfTrust-Manual.pdf`. The container includes
MkDocs, Pandoc, LaTeX, and the fonts used by the shared build rules. On a
wolfTrust pull request, `docs-site.yml` checks out the pinned documentation
revision, builds both outputs, runs MkDocs in strict mode, and uploads them
as one artifact. It also runs after documentation changes merge to `main`.
CI pulls the versioned builder image from GHCR, or builds it from
`docker/docs/` if that image is unavailable. No host package installation or
website credentials are needed for this check.

For an HTML preview, first run the build above, then run:

```sh
docker run --rm --user "$(id -u):$(id -g)" --env HOME=/tmp -p 8000:8000 \
--mount "type=bind,source=$PWD,target=/work/wolfTrust" \
--workdir /work/wolfTrust/build/documentation/wolfTrust \
wolftrust-docs:local mkdocs serve -a 0.0.0.0:8000 -f mkdocs.yml
```

The architecture diagram is maintained in `docs/assets/architecture.mmd`.
Regenerate its static image after editing it so HTML and PDF show the same
labels:

```sh
npx --yes @mermaid-js/mermaid-cli@12.0.0 \
-i docs/assets/architecture.mmd \
-o docs/assets/architecture.png \
-b white -c docs/assets/architecture.config.json -s 2
```

## Website update

The planned public locations are:

- [Full wolfTrust manual (HTML)](https://www.wolfssl.com/documentation/manuals/wolftrust/)
- [wolfTrust Manual (PDF)](https://www.wolfssl.com/documentation/manuals/wolftrust/wolfTrust-Manual.pdf)

These links become the public copies after the integration and website upload
are enabled. Before then, `docs/` and the `wolftrust-manual` CI artifact are
the available documentation.

The one-time integration in `wolfSSL/documentation` adds a `wolfTrust` manual
target beside wolfBoot and wolfHSM
([documentation PR #283](https://github.com/wolfSSL/documentation/pull/283)).
It clones `wolfSSL/wolfTrust` **main**, runs
the adapter from that checkout, and exports `wolfTrust-html/` and
`wolfTrust-Manual.pdf` through the documentation repository's existing Docker
build. Merge the wolfTrust adapter before that integration so its source is
available on `main`.

After both changes are merged, the existing nightly documentation build should
pick up `wolftrust` through the documentation repository's `all` target. No
manual trigger is needed for the normal update. Check the first nightly result
at `https://www.wolfssl.com/documentation/manuals/wolftrust/` and its
`wolfTrust-Manual.pdf`. The website upload rules are outside these public
repositories; if the nightly publishes an explicit list of manuals instead of
all build output, that list will need a one-time addition. Subsequent merged
wolfTrust documentation changes are read from wolfTrust `main` on the next
nightly run. Pull requests only build review artifacts.
Loading
Loading