-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (54 loc) · 1.52 KB
/
python_wheel.yml
File metadata and controls
62 lines (54 loc) · 1.52 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
name: Python Wheel
on:
push:
branches: ["*"]
tags: ["v*.*.*"] # and run on tags that describe new versions
pull_request:
types: [opened, reopened, synchronize]
jobs:
build-sdist-and-wheel:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: Setup uv
uses: ./.github/actions/setup-uv
- name: Build sdist and wheel
run: uv build
- name: Check wheel content
run: |
uvx check-wheel-contents dist/
uvx twine check dist/*
- name: Test wheel # TODO: replace this by using tox or nox
run: |
uv pip uninstall .
uv pip install dist/rydstate*.whl
uv run --no-project pytest
- name: Upload wheels
uses: actions/upload-artifact@v6
with:
name: dist
path: dist/rydstate*
publish-to-testpypi:
name: Publish to TestPyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to TestPyPI on tag pushes
needs: [build-sdist-and-wheel]
runs-on: ubuntu-latest
timeout-minutes: 15
environment:
name: testpypi
url: https://test.pypi.org/p/rydstate
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v7
with:
path: dist
pattern: dist
merge-multiple: true
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
repository-url: https://test.pypi.org/legacy/