19
19
container :
20
20
image : quay.io/pypa/manylinux2014_x86_64
21
21
env :
22
- TWINE_USERNAME : " __token__"
23
- TWINE_PASSWORD : ${{ secrets.PYPI_API_KEY }}
24
22
PLAT : manylinux2014_x86_64
25
23
PYBIN : ' /opt/python/${{ matrix.python }}/bin'
26
24
strategy :
@@ -63,10 +61,11 @@ jobs:
63
61
run : |
64
62
"${PYBIN}/pip" install cspy --no-index -f build/python/wheelhouse-repaired/
65
63
"${PYBIN}/python3" -m unittest discover -s test/python/
66
- - name : upload wheel
67
- run : |
68
- ${PYBIN}/pip install twine
69
- ${PYBIN}/python3 -m twine upload build/python/wheelhouse-repaired/*
64
+ - name : upload artifact
65
+ uses : actions/upload-artifact@v4
66
+ with :
67
+ name : linux-wheels
68
+ path : build/python/wheelhouse-repaired/
70
69
continue-on-error : true
71
70
72
71
macos-build :
76
75
matrix :
77
76
os : [macos-12, macos-13, macos-14]
78
77
python-version : [3.8, 3.9, "3.10", "3.11", "3.12"]
79
- env :
80
- TWINE_USERNAME : " __token__"
81
- TWINE_PASSWORD : ${{ secrets.PYPI_API_KEY }}
82
78
steps :
83
79
- uses : actions/checkout@v2
84
80
- name : Set up Python ${{ matrix.python-version }}
@@ -103,10 +99,11 @@ jobs:
103
99
delocate-wheel -w wheelhouse -v build/python/dist/*.whl
104
100
cd build
105
101
ctest --verbose -R python_unittest
106
- - name : upload wheel
107
- run : |
108
- python3 -m pip install twine
109
- twine upload wheelhouse/*
102
+ - name : upload artifact
103
+ uses : actions/upload-artifact@v4
104
+ with :
105
+ name : macos-wheels
106
+ path : wheelhouse/
110
107
continue-on-error : true
111
108
112
109
windows-build :
@@ -132,8 +129,45 @@ jobs:
132
129
run : |
133
130
cd build
134
131
ctest -C Release --verbose
135
- - name : upload wheel
136
- run : |
137
- pip install twine
138
- twine upload .\build\python\dist\*
132
+ - name : upload artifact
133
+ uses : actions/upload-artifact@v4
134
+ with :
135
+ name : windows-wheels
136
+ path : build/python/dist/
139
137
continue-on-error : true
138
+
139
+ pypi-publish :
140
+ name : Upload release to PyPI
141
+ needs : [build-manylinux2014-x86_64-wheel, macos-build, windows-build]
142
+ runs-on : ubuntu-latest
143
+ environment :
144
+ name : pypi
145
+ url : https://pypi.org/p/cspy
146
+ permissions :
147
+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
148
+ steps :
149
+ # retrieve your distributions here
150
+ - uses : actions/download-artifact@v4
151
+ with :
152
+ name : linux-wheels
153
+ path : allwheels
154
+ - name : Display structure of Linux wheels
155
+ run : ls -R allwheels
156
+ - uses : actions/download-artifact@v4
157
+ with :
158
+ name : macos-wheels
159
+ path : allwheels
160
+ - uses : actions/download-artifact@v4
161
+ with :
162
+ name : windows-wheels
163
+ path : allwheels
164
+ - name : Display allwheels dir
165
+ run : ls -R allwheels
166
+
167
+ - name : Publish package distributions to PyPI
168
+ uses : pypa/gh-action-pypi-publish@release/v1
169
+ with :
170
+ packages-dir : allwheels
171
+ verbose : true
172
+ skip-existing : true
173
+ password : ${{ secrets.PYPI_API_KEY }}
0 commit comments