From 198b46dc6490ed568c493ea0b08f6955a336888b Mon Sep 17 00:00:00 2001 From: Pavel Guzenfeld Date: Mon, 1 Jun 2026 19:21:20 +0300 Subject: [PATCH 1/2] :books: ci: automate docs deploy + releases; fix dead badges/links The website (boost-ext.github.io/sml) is served from the gh-pages branch but nothing regenerated it - the branch has been frozen since 2022-09-07. And cutting a release only bumped the version in source; no tag/Release was ever created (latest published Release is still v1.1.13, although master is v1.2.0). This adds the missing automation and fixes stale doc content: - .github/workflows/docs.yml: build the MkDocs site and publish to gh-pages on doc changes to master (and via manual dispatch). keep_files preserves the /boost classic mirror. - .github/workflows/release.yml: manual dispatch that tags vX.Y.Z from BOOST_SML_VERSION and creates a GitHub Release from the CHANGELOG section (idempotent - no-op if the release already exists). - .mkdocs.yml: build on current MkDocs/Python - drop the os.getenv custom_dir hack and the dead Universal Analytics property (sunset by Google in 2023). - doc/index.md, doc/overview.md: replace dead Travis/AppVeyor badges and compiler links with the GitHub Actions equivalents; use the shields release badge. - Makefile: restore 'make doc'/'make serve' targets (mkdocs). --- .github/workflows/docs.yml | 51 +++++++++++++++++++++++++ .github/workflows/release.yml | 72 +++++++++++++++++++++++++++++++++++ .mkdocs.yml | 7 ++-- Makefile | 12 +++++- doc/index.md | 5 +-- doc/overview.md | 6 +-- 6 files changed, 141 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..7b9c7781 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,51 @@ +name: docs + +# Build the MkDocs site from doc/ and publish it to the gh-pages branch +# (https://boost-ext.github.io/sml/). Runs automatically when documentation +# sources change on master, and can be triggered manually for a release. + +on: + push: + branches: [master] + paths: + - 'doc/**' + - '.mkdocs.yml' + - 'include/boost/sml.hpp' + - '.github/workflows/docs.yml' + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: docs-deploy + cancel-in-progress: true + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install MkDocs + run: pip install mkdocs + + - name: Build site + run: mkdocs build --config-file .mkdocs.yml --clean --site-dir site + + - name: Publish to gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./site + publish_branch: gh-pages + # Preserve files that are not regenerated by this build + # (e.g. the /boost classic-theme mirror). + keep_files: true + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' + commit_message: 'docs: deploy site from ${{ github.sha }}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ab3992a7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,72 @@ +name: release + +# Cut a GitHub Release for the version currently on master. +# +# Manually triggered. It reads BOOST_SML_VERSION from include/boost/sml.hpp, +# creates the matching vX.Y.Z tag (if missing) and a GitHub Release whose notes +# are the matching section of doc/CHANGELOG.md. Safe to re-run: it is a no-op if +# the release already exists. + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g. 1.2.0). Leave empty to read it from include/boost/sml.hpp.' + required: false + default: '' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Resolve version + id: ver + run: | + version="${{ github.event.inputs.version }}" + if [ -z "$version" ]; then + # BOOST_SML_VERSION is written as e.g. 1'2'0 -> 1.2.0 + version=$(grep -E '#define BOOST_SML_VERSION' include/boost/sml.hpp \ + | grep -oE "[0-9]+'[0-9]+'[0-9]+" | tr "'" '.') + fi + if [ -z "$version" ]; then + echo "::error::could not determine version"; exit 1 + fi + echo "version=$version" >> "$GITHUB_OUTPUT" + echo "tag=v$version" >> "$GITHUB_OUTPUT" + echo "Releasing v$version" + + - name: Extract changelog section + id: notes + run: | + version="${{ steps.ver.outputs.version }}" + # Print the block from "## [x.y.z]" up to (but not including) the next "## [". + awk -v v="$version" ' + $0 ~ "^## \\[" v "\\]" {grab=1; next} + grab && /^## \[/ {exit} + grab {print} + ' doc/CHANGELOG.md > RELEASE_NOTES.md + if [ ! -s RELEASE_NOTES.md ]; then + echo "See doc/CHANGELOG.md" > RELEASE_NOTES.md + fi + echo "----- release notes -----"; cat RELEASE_NOTES.md + + - name: Create tag and release (idempotent) + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tag="${{ steps.ver.outputs.tag }}" + if gh release view "$tag" >/dev/null 2>&1; then + echo "Release $tag already exists - nothing to do." + exit 0 + fi + gh release create "$tag" \ + --target "${{ github.sha }}" \ + --title "$tag" \ + --notes-file RELEASE_NOTES.md diff --git a/.mkdocs.yml b/.mkdocs.yml index 12feb6c6..7afaa8f7 100644 --- a/.mkdocs.yml +++ b/.mkdocs.yml @@ -1,6 +1,6 @@ -copyright: Copyright © 2016-2020 +copyright: Copyright © 2016-2026 site_name: "[Boost::ext].SML" -site_url: http://boost-ext.github.io/sml +site_url: https://boost-ext.github.io/sml site_author: Kris Jusiak repo_url: https://github.com/boost-ext/sml repo_name: sml @@ -8,8 +8,7 @@ docs_dir: doc use_directory_urls: false theme: name: null - custom_dir: !!python/object/apply:os.getenv ["MKDOCS_THEME_DIR"] -google_analytics: ['UA-73083568-1', 'auto'] + custom_dir: doc/themes/boost-modern extra_javascript: [] extra_css: [] diff --git a/Makefile b/Makefile index c0beef17..a07212dc 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,10 @@ # Memcheck: make test MEMCHECK=VALGRIND # Coverage: make test COVERAGE=GCOV # -.PHONY: all test example style static_analysis clean +.PHONY: all test example style static_analysis doc serve clean CXX ?= g++ +MKDOCS ?= mkdocs CXXSTD ?= c++14 _STD = $(subst c++,,$(CXXSTD)) BDIR = build-$(CXXSTD) @@ -67,5 +68,12 @@ style: $(BDIR)/.configured static_analysis: $(BDIR)/.configured $(CMAKE) --build $(BDIR) --target clang-tidy +# Documentation (https://boost-ext.github.io/sml). Requires: pip install mkdocs +doc: + $(MKDOCS) build --config-file .mkdocs.yml --clean --site-dir site + +serve: + $(MKDOCS) serve --config-file .mkdocs.yml + clean: - rm -rf $(BDIR) + rm -rf $(BDIR) site diff --git a/doc/index.md b/doc/index.md index 28178acf..271c80e7 100644 --- a/doc/index.md +++ b/doc/index.md @@ -1,7 +1,6 @@ ![Boost Licence](http://img.shields.io/badge/license-boost-blue.svg) -![Version](https://badge.fury.io/gh/boost-ext%2Fsml.svg) -![Build Status](https://img.shields.io/travis/boost-ext/sml/master.svg?label=linux/osx) -![Build Status](https://img.shields.io/appveyor/ci/boost-ext/sml/master.svg?label=windows) +![Version](https://img.shields.io/github/v/release/boost-ext/sml) +![Build](https://github.com/boost-ext/sml/actions/workflows/build_matrix.yml/badge.svg) ![Codecov](https://codecov.io/gh/boost-ext/sml/branch/master/graph/badge.svg) ![Github Issues](https://img.shields.io/github/issues/boost-ext/sml.svg) diff --git a/doc/overview.md b/doc/overview.md index 29dfbe8c..e55dccb7 100644 --- a/doc/overview.md +++ b/doc/overview.md @@ -27,9 +27,9 @@ git clone https://github.com/boost-ext/sml && cd sml && make test ###Supported/Tested compilers -* [Clang-3.4+](https://travis-ci.org/boost-ext/sml) -* [GCC-5.2+](https://travis-ci.org/boost-ext/sml) -* [MSVC-2015](https://ci.appveyor.com/project/krzysztof-jusiak/sml) +* [Clang-3.4+](https://github.com/boost-ext/sml/actions/workflows/build_matrix.yml) +* [GCC-5.2+](https://github.com/boost-ext/sml/actions/workflows/build_matrix.yml) +* [MSVC-2015+](https://github.com/boost-ext/sml/actions/workflows/build_matrix.yml) * Known limitations ```cpp From 8f30392ea9ed3f1481437eacb377c09342492219 Mon Sep 17 00:00:00 2001 From: Pavel Guzenfeld Date: Mon, 1 Jun 2026 19:21:28 +0300 Subject: [PATCH 2/2] :books: doc: credit v1.2.0 release contributor in acknowledgements --- doc/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/index.md b/doc/index.md index 271c80e7..149d4453 100644 --- a/doc/index.md +++ b/doc/index.md @@ -146,3 +146,4 @@ to avoid it `[Boost].SML` may suit you! * Thanks to [Oliver Daniell](https://github.com/oliverdaniell) for all contributions * Thanks to [Julius Gelšvartas](https://github.com/JuliusGel) for bug fixes * Thanks to [Christopher Motl](https://github.com/cmotl) for documentation fixes +* Thanks to [Pavel Guzenfeld](https://github.com/PavelGuzenfeld) ([pavelguzenfeld.com](https://pavelguzenfeld.com)) for the v1.2.0 release and numerous bug fixes