Skip to content

fix: Python version specifier in GH actions workflow #2

fix: Python version specifier in GH actions workflow

fix: Python version specifier in GH actions workflow #2

Workflow file for this run

name: Build sdist and wheels and publish them to PyPI on release
on:
push:
branches:
- master
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: |
3.10
3.11
3.12
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install hatch
run: |
pipx install hatch
hatch --version
- name: Build the package
run: |
hatch build
- name: Publish the package to PyPI
if: github.event.release
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}