This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
Release #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |