Skip to content
Merged
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
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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 }}'
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 3 additions & 4 deletions .mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
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
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: []

Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions doc/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<a href="http://www.boost.org/LICENSE_1_0.txt" target="_blank">![Boost Licence](http://img.shields.io/badge/license-boost-blue.svg)</a>
<a href="https://github.com/boost-ext/sml/releases" target="_blank">![Version](https://badge.fury.io/gh/boost-ext%2Fsml.svg)</a>
<a href="https://travis-ci.org/boost-ext/sml" target="_blank">![Build Status](https://img.shields.io/travis/boost-ext/sml/master.svg?label=linux/osx)</a>
<a href="https://ci.appveyor.com/project/boost-ext/sml" target="_blank">![Build Status](https://img.shields.io/appveyor/ci/boost-ext/sml/master.svg?label=windows)</a>
<a href="https://github.com/boost-ext/sml/releases" target="_blank">![Version](https://img.shields.io/github/v/release/boost-ext/sml)</a>
<a href="https://github.com/boost-ext/sml/actions/workflows/build_matrix.yml" target="_blank">![Build](https://github.com/boost-ext/sml/actions/workflows/build_matrix.yml/badge.svg)</a>
<a href="https://codecov.io/gh/boost-ext/sml" target="_blank">![Codecov](https://codecov.io/gh/boost-ext/sml/branch/master/graph/badge.svg)</a>
<a href="https://github.com/boost-ext/sml/issues" target="_blank">![Github Issues](https://img.shields.io/github/issues/boost-ext/sml.svg)</a>

Expand Down Expand Up @@ -147,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
6 changes: 3 additions & 3 deletions doc/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading