diff --git a/.github/workflows/cppverify-docs.yml b/.github/workflows/cppverify-docs.yml index d00f6803ef..65b076d784 100644 --- a/.github/workflows/cppverify-docs.yml +++ b/.github/workflows/cppverify-docs.yml @@ -27,9 +27,11 @@ jobs: build: runs-on: ubuntu-latest steps: + # Every tag: each release series is built from its latest tag. - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 0 - uses: actions/setup-python@v5 with: @@ -41,11 +43,11 @@ jobs: run: sudo apt-get update && sudo apt-get install -y doxygen - name: Build documentation - run: ./website/scripts/build-docs.sh + run: ./website/scripts/build-site.sh - uses: actions/upload-pages-artifact@v3 with: - path: website/build + path: website/site deploy: if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' diff --git a/.github/workflows/cppverify-release.yml b/.github/workflows/cppverify-release.yml index 5e9368d37d..8b931973ee 100644 --- a/.github/workflows/cppverify-release.yml +++ b/.github/workflows/cppverify-release.yml @@ -86,6 +86,7 @@ jobs: esac llvm="$(dist/cpp-verify/bin/cpp-verify --version | sed -n 's/^ based on LLVM \([0-9.]*\).*/\1/p')" name="cpp-verify-$version-llvm$llvm-${{ matrix.platform }}" + series="$(echo "$version" | cut -d. -f1,2)" mv dist/cpp-verify "dist/$name" cp LICENSE.TXT "dist/$name/LICENSE.TXT" cp third_party/z3/LICENSE.txt "dist/$name/LICENSE-Z3.txt" @@ -98,7 +99,7 @@ jobs: cvc5 (--backend=cvc5, portfolio, race) and Lean (--lean-certify) are found on PATH; cpp-verify --version shows what it finds. - Documentation: https://swayaminsync.github.io/cpp-verify/ + Documentation: https://swayaminsync.github.io/cpp-verify/$series/ EOF tar -C dist -cJf "$name.tar.xz" "$name" shasum -a 256 "$name.tar.xz" > "$name.tar.xz.sha256" @@ -147,6 +148,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + actions: write steps: - uses: actions/download-artifact@v4 with: @@ -157,11 +159,12 @@ jobs: GH_TOKEN: ${{ github.token }} run: | version="${TAG#v}" + series="$(echo "$version" | cut -d. -f1,2)" flags=() case "$version" in *-*) flags+=(--prerelease) ;; esac cat > notes.md < /dev/null) + sphinx-build -q -W -b html \ + -D "html_title=$title" \ + -D "html_theme_options.announcement=$banner" \ + "$tree/website/source" "$tree/website/build" + python3 "$tree/website/scripts/verify-book-sidebar.py" + mkdir -p "$out" + cp -R "$tree/website/build/." "$out/" +} + +# The release series and the tag each publishes, newest first, as +# "SERIES TAG" lines; a final release is preferred to its candidates. +releases="$(git -C "$ROOT" tag -l 'v[0-9]*' | python3 -c ' +import re, sys +def key(tag): + m = re.fullmatch(r"v(\d+)\.(\d+)\.(\d+)(?:-rc\.(\d+))?", tag) + if not m: + return None + major, minor, patch, rc = m.groups() + # A release sorts after its candidates. + return (int(major), int(minor), int(patch), 1 if rc is None else 0, + int(rc or 0)) +latest = {} +for tag in sys.stdin.read().split(): + k = key(tag) + if k and (k[:2] not in latest or k > latest[k[:2]][0]): + latest[k[:2]] = (k, tag) +for series in sorted(latest, reverse=True): + print("%d.%d %s" % (series + (latest[series][1],))) +')" +# The newest final release, documented at the root. +latest_tag="$(echo "$releases" | awk '$2 !~ /-rc\./ { print $2; exit }')" +latest="${latest_tag#v}" + +rm -rf "$OUT" +mkdir -p "$OUT" + +dev="$(sed -n 's/^set(CPPVERIFY_VERSION \(.*\))$/\1/p' "$ROOT/clang/lib/Verify/CMakeLists.txt")" +if [[ -n "$latest" ]]; then + dev_banner="This is the documentation of the development version, $dev, \ +built from main. The latest release is $latest: \ +its documentation." +else + dev_banner="This is the documentation of the development version, $dev, \ +built from main." +fi +echo "==> dev: $dev" +build_tree "$ROOT" "$OUT/dev" "CppVerify $dev" "$dev_banner" + +while read -r series tag; do + [[ -n "$tag" ]] || continue + version="${tag#v}" + if [[ "$tag" == "$latest_tag" ]]; then + banner="This is the documentation of cpp-verify $version, the latest \ +release. The development version documents \ +what main adds." + else + banner="This is the documentation of cpp-verify $version. The latest \ +release is $latest: its documentation." + fi + echo "==> $series: $tag" + tree="$WORK/$tag" + mkdir -p "$tree" + git -C "$ROOT" archive "$tag" website docs clang/lib/Verify | tar -x -C "$tree" + build_tree "$tree" "$OUT/$series" "CppVerify $version" "$banner" + if [[ "$tag" == "$latest_tag" ]]; then + cp -R "$OUT/$series/." "$OUT/" + fi +done <<< "$releases" + +# Before any release, the development version is the root. +if [[ -z "$latest" ]]; then + cp -R "$OUT/dev/." "$OUT/" +fi + +echo "==> Done" +echo " Site: file://$OUT/index.html" diff --git a/website/source/release-notes.rst b/website/source/release-notes.rst index b8abf5d90b..889f498cfc 100644 --- a/website/source/release-notes.rst +++ b/website/source/release-notes.rst @@ -147,6 +147,13 @@ queries could run another function's long query, delaying its result and spending its ``--function-timeout``. A waiting function now runs only its own queries (:doc:`language/tooling`). +**Documentation for each version.** The site showed only ``main``, so a user +of a release read about features their binary did not have. Its root now +documents the latest release, ``/X.Y/`` each release series (``/0.1/`` is +0.1.1), and ``/dev/`` the development version on ``main``. A banner on every +page names its version, and each release's archive and notes link to its own +series. + **cvc5 1.4.** Every query over sets, multisets, and maps failed with cvc5 1.4, which requires extended arrays for constant arrays; such a query now enables them itself (:doc:`language/tooling`).