Skip to content

v1.2.2

v1.2.2 #36

Workflow file for this run

name: Release to PyPI
on:
release:
types: [published]
permissions:
contents: read
id-token: write
jobs:
build-and-publish:
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.release.tag_name }}
- name: Set version from tag
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
sed -i "s/^version = .*/version = \"${VERSION}\"/" pyproject.toml
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build package
run: |
pip install build
python -m build
- name: Upload artifacts to Actions
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1