-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 984 Bytes
/
publish.yml
File metadata and controls
43 lines (37 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Publish
on:
workflow_dispatch:
inputs:
tag:
description: "Tag to publish (e.g. v1.0.0)"
required: true
type: string
repository_url:
description: "PyPI repository URL (blank for PyPI)"
required: false
default: ""
type: string
jobs:
publish:
runs-on: ubuntu-latest
environment: pypi
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install dependencies
run: uv sync
- name: Build
run: uv run hatch build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
repository-url: ${{ inputs.repository_url || 'https://pypi.org/legacy/' }}
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}