Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Release

Release #24

Workflow file for this run

name: Release
on:
workflow_run:
workflows: ["Lint", "Test"]
types:
- completed
push:
branches:
- main
paths:
- 'src/**.py'
pull_request:
branches:
- main
paths:
'src/**.py'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python, Poetry, and Dependencies
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: 3.12.1
poetry-version: 1.8.2
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@composite-github-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish GitHub Release
uses: python-semantic-release/upload-to-gh-release@main
if: ${{ steps.release.outputs.released }} == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.version }}
outputs:
released: ${{ steps.release.outputs.released }}
docs:
name: Build Documentation
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.released == 'true' && github.ref == 'refs/heads/main'
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Python, Poetry, and Dependencies
uses: packetcoders/action-setup-cache-python-poetry@main
with:
python-version: 3.12.1
poetry-version: 1.8.2
- name: Add Poetry's bin directory to the PATH
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
- name: Build HTML
run: |
cd docs/
make html
- name: Run ghp-import
run: |
ghp-import -n -p -f docs/_build/html