@@ -9,62 +9,130 @@ name: Python Build
9
9
pull_request :
10
10
11
11
jobs :
12
- from-sdist :
13
- name : python unit-tests
12
+ from_uv :
13
+ name : python uv installation
14
14
runs-on : ubuntu-latest
15
15
steps :
16
+ - uses : actions/checkout@v4
16
17
- name : Install uv
17
18
uses : astral-sh/setup-uv@v5
18
19
with :
19
20
version : " 0.6.5"
20
21
- name : " Set up Python"
21
22
uses : actions/setup-python@v5
22
23
with :
23
- python-version : 3.8
24
24
python-version-file : " pyproject.toml"
25
25
26
26
- name : Install pyssht
27
27
run : uv sync --all-extras --dev
28
28
29
29
- name : run pytest
30
- run : uv run pytest tests/test_pyssht.py
30
+ run : uv run pytest
31
+
32
+ from_sdist :
33
+ name : python source distribution
34
+ runs-on : ubuntu-latest
35
+ steps :
36
+ - uses : actions/checkout@v4
37
+ - name : Install uv
38
+ uses : astral-sh/setup-uv@v5
39
+ with :
40
+ version : " 0.6.5"
41
+
42
+ - name : " Set up Python"
43
+ uses : actions/setup-python@v5
44
+ with :
45
+ python-version-file : " pyproject.toml"
46
+
47
+ - name : Build sdist
48
+ run : uv build --sdist
49
+
50
+ - name : create venv
51
+ run : uv venv
52
+
53
+ - name : install wheel
54
+ run : " uv pip install dist/pyssht-*.tar.gz"
55
+
56
+ - name : run pytests
57
+ run : uv pip install pytest && uv run pytest
31
58
32
59
build_wheels :
33
- name : Build wheels on ${{ matrix.os }}
60
+ name : Build wheels
34
61
runs-on : macos-latest
35
62
36
63
steps :
64
+ - uses : actions/checkout@v4
37
65
- name : Install uv
38
66
uses : astral-sh/setup-uv@v5
39
67
with :
40
68
version : " 0.6.5"
41
69
- name : " Set up Python"
42
70
uses : actions/setup-python@v5
43
71
with :
44
- python-version : 3.8
72
+ python-version-file : " pyproject.toml "
45
73
46
74
- name : Build wheels
47
75
run : uv build --wheel
48
76
77
+ - name : create venv
78
+ run : uv venv
79
+
49
80
- name : install wheel
50
- run : " pip install dist/*.whl"
81
+ run : " uv pip install dist/*.whl"
51
82
52
83
- name : run pytests
53
- run : uv pip install pytest && pytest tests
84
+ run : uv pip install pytest && uv run pytest
54
85
55
- publication :
56
- name : publish to pypi
86
+ publish_wheels :
87
+ name : Build wheels and publish on ${{ matrix.os }}
57
88
if : ${{ startsWith(github.ref, 'refs/tags') }}
58
- runs-on : macos-latest
89
+ runs-on : ${{ matrix.os }}
90
+ strategy :
91
+ matrix :
92
+ os : [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-14]
93
+ permissions :
94
+ id-token : write
59
95
steps :
96
+ - uses : actions/checkout@v4
60
97
- name : Install uv
61
98
uses : astral-sh/setup-uv@v5
62
99
with :
63
100
version : " 0.6.5"
101
+
102
+ - name : Build wheels
103
+
104
+ env :
105
+ CIBW_SKIP : " cp36-* cp37-* cp38-* pp* *musllinux*"
106
+ CIBW_BUILD_FRONTEND : " build[uv]"
107
+
108
+ - name : Publish distribution 📦 to Test PyPI
109
+ if : ${{ github.ref != 'refs/tags/v1.5.2' }}
110
+ run : " uv publish --publish-url https://test.pypi.org/legacy/ wheelhouse/*.whl"
111
+
112
+ - name : Publish distribution 📦 to PyPI
113
+ if : ${{ github.ref == 'refs/tags/v1.5.2' }}
114
+ run : " uv publish wheelhouse/*.whl"
115
+
116
+ publish_sdist :
117
+ name : Build sdist and publish on ubuntu
118
+ if : ${{ startsWith(github.ref, 'refs/tags') }}
119
+ runs-on : ubuntu-latest
120
+ permissions :
121
+ id-token : write
122
+ steps :
123
+ - uses : actions/checkout@v4
124
+ - name : Install uv
125
+ uses : astral-sh/setup-uv@v5
126
+ with :
127
+ version : " 0.6.5"
128
+
129
+ - name : Build sdist
130
+ run : uv build --sdist
131
+
64
132
- name : Publish distribution 📦 to Test PyPI
65
133
if : ${{ github.ref != 'refs/tags/v1.5.2' }}
66
- run : " uv publish --publish-url https://test.pypi.org/legacy --token ${{ secrets.TEST_PYPI_TOKEN }} "
134
+ run : " uv publish --publish-url https://test.pypi.org/legacy/ dist/*.tar.gz "
67
135
68
136
- name : Publish distribution 📦 to PyPI
69
137
if : ${{ github.ref == 'refs/tags/v1.5.2' }}
70
- run : " uv publish --token ${{ secrets.TEST_PYPI_TOKEN }} "
138
+ run : " uv publish dist/*.tar.gz "
0 commit comments