Skip to content

v1.5.1

v1.5.1 #95

Workflow file for this run

name: Build Documentation
on:
workflow_dispatch:
release:
types: [published]
env:
Python_Version: '3.10'
jobs:
build_docs:
name: Build Documentation
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{env.Python_Version}}
- name: Python Cache Key
shell: bash
run: |
echo $(which python) > /tmp/python_version.txt
- name: Get pip cache dir
shell: bash
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Pip-Tools
shell: bash
run: |
python -m pip install pip-tools
pip-compile setup.cfg
pip-compile build-requirements.in
pip-compile doc-requirements.in
- name: pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('build-requirements.txt') }}-${{ hashFiles('doc-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('build-requirements.txt') }}-${{ hashFiles('doc-requirements.txt') }}
${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('build-requirements.txt') }}-
${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }}-${{ hashFiles('requirements.txt') }}-
${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }}-
- name: Update
run: |
pip install --upgrade pip wheel setuptools build cmake ninja
- name: Install Dependencies
shell: bash
run: |
set -eux
pip-sync requirements.txt build-requirements.txt doc-requirements.txt
- name: Install Dep
run: |
pip install typing-extensions
sudo apt-get install -y libeigen3-dev lcov graphviz mscgen dia pdf2svg astyle
sudo apt-get install -y doxygen doxygen-doxyparse fonts-liberation python3-breathe
- name: Prepare
shell: bash
run: mkdir build
- name: CMake Configure
shell: bash
run: >
cmake
-DBUILD_DOCS=ON
-G Ninja
-S .
-B build
- name: CMake Build
shell: bash
run: >
cmake
--build build
--parallel
--verbose
--target cxxcimod_header_only_docs
- name: Copy Doc
shell: bash
run: |
set -eux
cp -r ./build/html/* ./public/
- name: du -a
shell: bash
if: always()
run: |
du -a
- name: Prepare tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF##refs/tags/}"
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
echo "deploy_tag_name=deploy-${TAG_NAME}" >> $GITHUB_OUTPUT
- name: Deploy
#if: ${{github.event_name == 'release'}}
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.CIMOD_DOC }}
keep_files: true
allow_empty_commit: true
publish_dir: ./public
publish_branch: main
external_repository: OpenJij/Cimod-Documentation
destination_dir: www
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: ${{ github.event.head_commit.message }}
full_commit_message: ${{ github.event.head_commit.message }}
tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'