Skip to content

Publish to PyPI

Publish to PyPI #7

Workflow file for this run

name: Publish to PyPI
run-name: Publish to PyPI
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync
- name: Build and publish
run: |
export VERSION=$(git describe --tags --abbrev=0)
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
uv build
uv publish --token ${{ secrets.PYPI_API_TOKEN }}
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
- name: Create Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
draft: false
makeLatest: true
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: "docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]"
file_pattern: CHANGELOG.md