fix: use only Python 3.11 in GH actions workflow for now #3
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: 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.11' | |
- 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 }} |