| 1 |
name: Build package and push to PyPi |
| 2 |
|
| 3 |
on: |
| 4 |
workflow_dispatch: |
| 5 |
push: |
| 6 |
tags: |
| 7 |
- "v*.*.*" |
| 8 |
|
| 9 |
jobs: |
| 10 |
build: |
| 11 |
runs-on: ubuntu-latest |
| 12 |
permissions: |
| 13 |
contents: read |
| 14 |
steps: |
| 15 |
- uses: actions/checkout@v6 |
| 16 |
with: |
| 17 |
fetch-depth: 0 |
| 18 |
- uses: astral-sh/setup-uv@v7 |
| 19 |
with: |
| 20 |
enable-cache: false |
| 21 |
- run: uv build |
| 22 |
- uses: actions/upload-artifact@v7 |
| 23 |
with: |
| 24 |
name: dist |
| 25 |
path: dist/ |
| 26 |
|
| 27 |
publish: |
| 28 |
needs: build |
| 29 |
if: github.event_name != 'workflow_dispatch' |
| 30 |
runs-on: ubuntu-latest |
| 31 |
permissions: |
| 32 |
id-token: write |
| 33 |
environment: |
| 34 |
name: pypi |
| 35 |
url: https://pypi.org/p/cyclopts |
| 36 |
steps: |
| 37 |
- uses: actions/download-artifact@v8 |
| 38 |
with: |
| 39 |
name: dist |
| 40 |
path: dist/ |
| 41 |
- uses: pypa/[email protected] |