Skip to content

Publish to PyPI

Publish to PyPI #13

Workflow file for this run

name: Publish to PyPI
on:
push:
tags:
- "v*"
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=$(echo $(git describe --tags --abbrev=0) | sed 's/^v//')
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
uv build
uv publish --token ${{ secrets.PYPI_API_TOKEN }}
- name: "Get Previous tag"
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: ${{ steps.previoustag.outputs.tag }}
# toTag: ${{ github.ref_name }}
writeToFile: false
- name: Create Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
draft: true
makeLatest: true
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
bodyFile: "CHANGELOG.md"
token: ${{ secrets.GITHUB_TOKEN }}