Skip to content
Merged
32 changes: 23 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
merge_group:
workflow_dispatch:

permissions: {}

env:
PYTHON_LATEST: 3.13

Expand All @@ -24,6 +26,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_LATEST }}
Expand Down Expand Up @@ -75,6 +78,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -95,17 +100,25 @@ jobs:
path: coverage/coverage.*
if-no-files-found: error

lint-github-actions:
name: Lint GitHub Actions
permissions:
security-events: write
uses: zizmorcore/workflow/.github/workflows/reusable-zizmor.yml@3bb5e95068d0f44b6d2f3f7e91379bed1d2f96a8

check:
name: Check
if: always()
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_LATEST }}
Expand All @@ -124,7 +137,7 @@ jobs:
coverage combine
coverage xml
- name: Upload coverage report
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
with:
files: coverage.xml
fail_ci_if_error: true
Expand All @@ -139,6 +152,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Install Python
uses: actions/setup-python@v5
- name: Install towncrier
Expand All @@ -150,7 +164,9 @@ jobs:
run: pip install .
- name: Compile Release Notes Draft
if: ${{ !contains(github.ref, 'refs/tags/') }}
run: towncrier build --draft --version "${{ needs.lint.outputs.version }}" > release-notes.rst
run: towncrier build --draft --version "${version}" > release-notes.rst
env:
version: ${{ needs.lint.outputs.version }}
- name: Extract release notes from Git tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
run: |
Expand All @@ -174,6 +190,8 @@ jobs:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [lint, check, prepare-release-notes]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v4
Expand All @@ -184,18 +202,14 @@ jobs:
run: |
tree dist
- name: PyPI upload
uses: pypa/[email protected]
with:
attestations: true
packages-dir: dist
password: ${{ secrets.PYPI_API_TOKEN }}
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
- name: Download Release Notes
uses: actions/download-artifact@v4
with:
name: release-notes.md
path: release-notes.md
- name: GitHub Release
uses: ncipollo/release-action@v1
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
with:
name: pytest-asyncio ${{ needs.lint.outputs.version }}
artifacts: dist/*
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ repos:
- id: pyproject-fmt
# https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version
additional_dependencies: [tox>=4.9]
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: v1.7.0
hooks:
- id: zizmor
ci:
skip:
- actionlint-docker
Expand Down
Loading