Skip to content

chore(release): v1.2.0 #31

chore(release): v1.2.0

chore(release): v1.2.0 #31

Workflow file for this run

name: Release to PyPI
on:
pull_request:
types: [closed]
branches:
- main
permissions:
contents: read
jobs:
build-and-publish:
name: Build and publish if release PR merged
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build deps
run: |
python -m pip install --upgrade pip
pip install build twine hatchling
- name: Build distributions
run: |
python -m build
- name: Twine check
run: |
python -m twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*