-
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 2.38 KB
/
Copy pathrelease.yaml
File metadata and controls
66 lines (55 loc) · 2.38 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Official docs:
# - https://docs.github.com/en/actions
# - https://github.com/actions
name: PyPI Release
env:
# Pin uv version for reproducible builds
# https://github.com/astral-sh/uv/releases
UV_VERSION: "0.9.26" # released on 2026-01-15
on:
push:
tags:
# - "v*" # only run on tags that start with 'v'
- "[0-9]+.[0-9]+.[0-9]+" # matches tags in the format X.Y.Z
permissions:
contents: read
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
# repo: https://github.com/astral-sh/setup-uv
# releases: https://github.com/astral-sh/setup-uv/tags
# docs: https://docs.astral.sh/uv/guides/integration/github
- name: Install pinned version of uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 released on 29-03-2026
with:
python-version: "3.11"
version: ${{ env.UV_VERSION }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Which Python
run: which python
- name: Install dependencies
run: uv sync --group packaging
- name: Build package
run: uv build
# - name: Publish distribution to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# https://github.com/pypa/gh-action-pypi-publish
# https://github.com/marketplace/actions/pypi-publish
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/