-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.06 KB
/
publish.yml
File metadata and controls
50 lines (41 loc) · 1.06 KB
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
45
46
47
48
49
50
name: Publish Python Package
on:
release:
types: [published]
jobs:
build-and-publish:
runs-on: windows-latest
permissions:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.2"
- name: Set up Python
run: |
uv python install 3.11
- name: Extract version from tag
run: |
$tag = "${{ github.event.release.tag_name }}"
if ($tag.StartsWith('v')) {
$version = $tag.Substring(1)
} else {
$version = $tag
}
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Set package version
run: |
uv version set $env:VERSION
- name: Build package
run: |
uv build
Get-ChildItem dist
- name: Publish to PyPI
run: uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}