ci(deps): update pypa/gh-action-pypi-publish action to v1.12.2 #871
Workflow file for this run
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: Main | |
on: | |
push: | |
branches: [main] | |
tags: | |
- "v*" | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
name: Lint code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
cache: poetry | |
- name: Install deps | |
run: poetry install | |
- name: Lint code | |
run: poetry run poe lint | |
tests: | |
name: Tests | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.11", "3.12", "3.13"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: poetry | |
- name: Install | |
run: poetry install | |
- name: Run tests | |
run: poetry run poe test | |
- name: Upload coverage to Codecov | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' | |
uses: codecov/codecov-action@4fe8c5f003fae66aa5ebb77cfd3e7bfbbda0b6b0 # v3.1.5 | |
pypi-deploy: | |
name: Release to PyPI | |
if: github.ref_type == 'tag' | |
needs: [lint, tests] | |
environment: pypi | |
permissions: | |
id-token: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: | | |
pipx install poetry | |
pipx inject poetry poetry-dynamic-versioning[plugin] | |
- uses: actions/setup-python@v5 | |
- name: Build package | |
run: poetry build | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2 | |
github-deploy: | |
name: Release to GitHub | |
if: github.ref_type == 'tag' | |
needs: [lint, tests] | |
environment: github-releases | |
permissions: | |
contents: write | |
env: | |
CHANGELOG: https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md | |
PRERELEASE: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create GitHub Release | |
run: | | |
gh release create ${{ github.ref_name }} \ | |
--title ${{ github.ref_name }} \ | |
--notes="See [the CHANGELOG](${{ env.CHANGELOG }}) for more details." \ | |
--draft=${{ env.PRERELEASE }} \ | |
--prerelease=${{ env.PRERELEASE }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
docs-build: | |
name: Build docs | |
if: github.ref_type == 'tag' | |
needs: [lint, tests] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: | | |
pipx install poetry | |
pipx inject poetry poetry-dynamic-versioning[plugin] | |
- uses: actions/setup-python@v5 | |
with: | |
cache: poetry | |
- name: Install deps | |
run: poetry install | |
- name: Build docs | |
run: poetry run mkdocs build | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: site | |
docs-deploy: | |
name: Deploy docs | |
if: true && !contains(github.ref, 'alpha') | |
needs: [docs-build] | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
id-token: write | |
pages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |