Skip to content

Merge pull request #114 from fgcz/main #9

Merge pull request #114 from fgcz/main

Merge pull request #114 from fgcz/main #9

name: Complete Release
on:
push:
branches: [stable]
# TODO remove after testing
workflow_dispatch:
jobs:
create_tag:
name: Create Tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Git Config
run: |
git config --global user.name "bfabricPy Bot"
git config --global user.email "[email protected]"
- name: Create tag (with Python)
run: |
set -euxo pipefail
# Find the version
VERSION=$(python3 -c "import tomllib; from pathlib import Path; print(tomllib.loads(Path('pyproject.toml').read_text())['project']['version'], end='')")
# Check if tag exists
if git rev-parse $VERSION >/dev/null 2>&1; then
echo "Tag $VERSION already exists"
exit 1
fi
# Create tag
git tag -a $VERSION -m "Release $VERSION"
# Push tag
git push origin $VERSION
publish_documentation:
name: Publish Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install nox
run: pip install nox uv
- name: Publish documentation
run: |
set -euxo pipefail
git fetch --unshallow origin gh-pages
git checkout gh-pages && git pull && git checkout -
nox -s docs
nox -s publish_docs