chore: actually, stop ignoring changes to the workflow file as well #1
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
on: | |
push: | |
paths-ignore: | |
- ".vscode/**" | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- ".vscode/**" | |
- "**.md" | |
workflow_dispatch: | |
name: CI | |
env: | |
PYTHON_VERSION: "3.8.18" | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
jobs: | |
lint: | |
name: Lint, check format and typing | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: eifinger/setup-rye@v4 | |
id: setup-rye | |
with: | |
enable-cache: true | |
cache-prefix: ${{ env.PYTHON_VERSION }} | |
- name: Pin python-version ${{ env.PYTHON_VERSION }} | |
run: rye pin ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
if: steps.setup-rye.outputs.cache-hit != 'true' | |
run: rye sync --no-lock | |
- name: Run rye lint | |
run: rye lint $(git ls-files "*.pyi") | |
- name: Run rye fmt | |
run: rye fmt $(git ls-files "*.pyi") -- --diff --check | |
- name: Run mypy | |
run: rye run mypy --explicit-package-bases $(git ls-files "*.pyi") | |
push: | |
name: Push to PyPi | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
needs: [lint] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: eifinger/setup-rye@v4 | |
id: setup-rye | |
with: | |
enable-cache: true | |
cache-prefix: ${{ env.python-version }} | |
- name: Pin python-version ${{ env.PYTHON_VERSION }} | |
run: rye pin ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: rye sync --no-lock | |
- name: Build | |
run: rye build | |
- name: Verify | |
run: rye run twine check dist/* | |
- name: Upload | |
run: rye run twine upload dist/* |