-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.27 KB
/
release.yml
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
44
name: Release
on:
workflow_dispatch:
inputs:
repository:
description: The index repository to publish to - PyPI or Test PyPI
required: true
default: testpypi
type: choice
options:
- pypi
- testpypi
jobs:
release:
runs-on: ubuntu-latest
env:
PYPI_PUBLISH: true
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get uv version
id: uv-version
run: |
content=$(cat .github/workflows/uv-constraint.txt)
echo "version=${content#uv==}" >> $GITHUB_OUTPUT
- uses: astral-sh/setup-uv@v5
with:
version: ${{ steps.uv-version.outputs.version }}
- name: Build the package
run: uv build --no-sources
- name: Publish the package
env:
UV_PUBLISH_TOKEN: ${{ inputs.repository == 'pypi' && secrets.PYPI_TOKEN || secrets.TEST_PYPI_TOKEN }}
UV_PUBLISH_URL: ${{ inputs.repository == 'pypi' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
run: uv publish
- name: Upload source and wheel distributions
uses: actions/upload-artifact@v4
with:
name: python-build-archives
path: dist/