Skip to content

0.0.20

0.0.20 #20

Workflow file for this run

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # for documentation builds
- name: Set up Python and dependencies
uses: ./.github/actions/setup-python
with:
pythonVersion: "3.11"
dependencyType: "dev"
- name: Install build tools
run: |
pip install build
python -m build
- name: Upload build artifacts
uses: actions/[email protected]
with:
name: dist
path: dist
publish_docs:
name: Publish documentation
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # for documentation builds
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Set up Python and dependencies
uses: ./.github/actions/setup-python
with:
pythonVersion: "3.11"
dependencyType: "docs"
- name: Append release notes to RELEASE_NOTES.md # automatically update release notes on new release
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git checkout main
echo "Appending new release notes to RELEASE_NOTES.md"
echo -e "\n## $(echo "${{ github.event.release.published_at }}" | cut -d'T' -f1) - version ${{ github.event.release.tag_name }}\n" >> RELEASE_NOTES.md
echo "${{ github.event.release.body }}" >> RELEASE_NOTES.md
echo -e "\n---\n" >> RELEASE_NOTES.md
git add RELEASE_NOTES.md
git commit -m "Updated release notes for ${{ github.event.release.tag_name }}"
git push origin main
- name: Publish documentation
uses: ./.github/actions/mike-docs
with:
version: ${{ github.event.release.tag_name }}
alias: latest
push: true
publish_pypi:
name: Publish wheels to PyPI
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Download build artifacts
uses: actions/[email protected]
with:
name: dist
path: dist
- name: Publish Python 🐍 distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true # tolerate release package file duplicates
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: false