@@ -2,38 +2,39 @@ name: Python Wheels
2
2
3
3
on :
4
4
push :
5
- branches : ["master"]
6
5
tags :
7
- - " **"
6
+ - " [0-9]+.[0-9]+.[0-9]+"
7
+ - " [0-9]+.[0-9]+.[0-9]+.post[0-9]+"
8
+ - " [0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
9
+ - " [0-9]+.[0-9]+.[0-9]+rc[0-9]+"
8
10
pull_request :
9
11
workflow_dispatch :
10
12
11
13
concurrency :
12
14
group : wheels-${{ github.ref }}
13
15
cancel-in-progress : true
14
16
15
-
16
17
jobs :
17
- build-wheels :
18
+ build_wheels :
18
19
runs-on : ${{ matrix.os }}
19
20
strategy :
20
21
matrix :
21
22
os : [macos-latest, windows-2019, ubuntu-latest]
22
23
name : Build CPython ${{ matrix.python-version }}-${{ matrix.os }}
23
24
steps :
24
- - uses : actions/checkout@v2
25
+ - uses : actions/checkout@v4
25
26
- uses : pypa/cibuildwheel@v2.11.2
26
27
env :
27
28
CIBW_ARCHS_MACOS : x86_64 universal2
28
29
CIBW_TEST_SKIP : ' *universal2:arm64'
29
30
CIBW_BUILD : " cp37-macosx_x86_64 cp38-macosx_universal2 cp37-win* cp37-manylinux_{x86_64,i686}"
30
- - uses : actions/upload-artifact@v2
31
+ - uses : actions/upload-artifact@v3
31
32
with :
32
33
name : python_bsonjs-3.7-${{ matrix.os }}-wheel
33
34
path : ./wheelhouse/*.whl
34
35
if-no-files-found : error
35
- test-non-linux-wheels :
36
- needs : build-wheels
36
+ test_non_linux_wheels :
37
+ needs : build_wheels
37
38
runs-on : ${{ matrix.os }}
38
39
strategy :
39
40
matrix :
58
59
python -m pip list | grep python-bsonjs
59
60
python -c "from bsonjs import dumps"
60
61
# Linux
61
- test-manylinux-wheels :
62
+ test_manylinux_wheels :
62
63
runs-on : ${{ matrix.os }}
63
- needs : build-wheels
64
+ needs : build_wheels
64
65
strategy :
65
66
matrix :
66
67
os : [ubuntu-latest]
@@ -80,25 +81,42 @@ jobs:
80
81
name : Make SDist
81
82
runs-on : ubuntu-latest
82
83
steps :
83
- - uses : actions/checkout@v2
84
+ - uses : actions/checkout@v4
84
85
- name : Build SDist
85
86
run : python setup.py sdist --dist-dir=dist --formats=gztar
86
- - uses : actions/upload-artifact@v2
87
+ - uses : actions/upload-artifact@v3
87
88
with :
88
89
name : " sdist"
89
90
path : dist/*.tar.gz
90
- collect-wheels :
91
+ collect_dist :
91
92
runs-on : ubuntu-latest
92
- needs : [build-wheels , make_sdist]
93
+ needs : [build_wheels , make_sdist]
93
94
name : Download Wheels
94
95
steps :
95
96
- name : Download all workflow run artifacts
96
- uses : actions/download-artifact@v2
97
+ uses : actions/download-artifact@v3
97
98
- name : Flatten directory
99
+ working-directory : .
98
100
run : |
99
101
find . -mindepth 2 -type f -exec mv {} . \;
100
102
find . -type d -empty -delete
101
- - uses : actions/upload-artifact@v2
103
+ - uses : actions/upload-artifact@v3
102
104
with :
103
- name : all-dist
104
- path : " ./*"
105
+ name : all-dist-${{ github.head_ref || github.ref_name }}
106
+ path : " ./*"
107
+ publish :
108
+ # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#publishing-the-distribution-to-pypi
109
+ needs : [collect_dist]
110
+ if : startsWith(github.ref, 'refs/tags/')
111
+ runs-on : ubuntu-latest
112
+ environment : release
113
+ permissions :
114
+ id-token : write
115
+ steps :
116
+ - name : Download all the dists
117
+ uses : actions/download-artifact@v3
118
+ with :
119
+ name : all-dist-${{ github.head_ref || github.ref_name }}
120
+ path : dist/
121
+ - name : Publish distribution 📦 to PyPI
122
+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments