Skip to content

Commit

Permalink
Add workflow to publish package to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
myui committed Dec 19, 2024
1 parent b135b82 commit 2509347
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will upload a Python Package to PyPI when a version tag is pushed

name: "Publish Python Package to PyPI"

on:
release:
types: ["published"]
push:
tags:
- 'v[0-9]+.[0-9]+*' # Push events to matching v1.0, v20.15.10 tags

jobs:
run:
name: "Build and publish release"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: uv.lock

- name: Print the installed version
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Build
run: uv build

- name: Publish
run: uv publish -t ${{ secrets.PYPI_TOKEN }}

0 comments on commit 2509347

Please sign in to comment.