chore: update ruff configurations (#7) #20
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: | |
branches: | |
- master | |
tags: | |
- "v*" | |
pull_request: | |
name: Build and release to pypi | |
jobs: | |
release-build: | |
name: Build and upload distributions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Build dist | |
run: uv tool run --with build[uv] --from build python -m build --installer uv | |
- name: Upload release distributions | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-dists | |
path: dist/ | |
pypi-publish: | |
name: Release to pypi | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi_publish | |
url: https://pypi.org/p/python-template | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
needs: | |
- release-build | |
permissions: | |
id-token: write | |
steps: | |
- name: Retrieve release distributions | |
uses: actions/download-artifact@v4 | |
with: | |
name: release-dists | |
path: dist/ | |
- name: Publish release distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |