-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.29 KB
/
publish.yaml
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
name: publish
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Restore px cache
uses: actions/cache@v4
with:
path: .pyprojectx
key: px-${{ runner.os }}-3_13-${{ hashFiles('pw.lock') }}
restore-keys: |
px-${{ runner.os }}-3_13-${{ hashFiles('pw.lock') }}
px-${{ runner.os }}
- name: Restore uv cache
uses: actions/cache@v4
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- run: ./pw uv build
- run: ./pw uv publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
# Upload wheel as a release asset
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} ./dist/*
- name: Minimize uv cache
run: ./pw uv cache prune --ci