6
6
types : [opened, edited, synchronize]
7
7
8
8
jobs :
9
- lib :
9
+ build :
10
+ name : Build wheels
10
11
runs-on : ubuntu-latest
11
12
strategy :
12
13
fail-fast : false
@@ -15,34 +16,51 @@ jobs:
15
16
16
17
steps :
17
18
- name : Checkout
18
- uses : actions/checkout@v2
19
+ uses : actions/checkout@v4
19
20
with :
20
21
fetch-depth : 0
21
22
22
23
- name : Install CPython
23
- uses : actions/setup-python@v2
24
+ uses : actions/setup-python@v5
24
25
with :
25
- python-version : ${{matrix.python-version}}
26
+ python-version : ${{ matrix.python-version }}
26
27
27
- - name : Install Deps
28
+ - name : Install deps
28
29
run : |
29
- python -m ensurepip
30
- pip install wheel setuptools
31
- pip install -r requirements.txt
30
+ pip install -U wheel setuptools pip Cython
31
+ pip install '.[speed,sound]'
32
32
33
- - name : Build
34
- run : python setup.py sdist bdist_wheel
33
+ - name : Build wheels
34
+ run : pip wheel -w ./wheelhouse/ '.[speed,sound]'
35
+
36
+ - uses : actions/upload-artifact@v4
37
+ with :
38
+ name : artifact-wheels-${{ matrix.python-version }}
39
+ path : ./wheelhouse/twitchio*.whl
40
+
41
+ sdist :
42
+ name : Make source distribution
43
+ runs-on : ubuntu-latest
44
+ steps :
45
+ - uses : actions/checkout@v4
46
+
47
+ - run : pipx run build --sdist
48
+
49
+ - uses : actions/upload-artifact@v4
50
+ with :
51
+ name : artifact-source-dist
52
+ path : " ./**/dist/*.tar.gz"
35
53
36
54
docs :
37
55
runs-on : ubuntu-latest
38
56
steps :
39
57
- name : Checkout
40
- uses : actions/checkout@v2
58
+ uses : actions/checkout@v4
41
59
with :
42
60
fetch-depth : 0
43
61
44
62
- name : Install CPython
45
- uses : actions/setup-python@v2
63
+ uses : actions/setup-python@v5
46
64
with :
47
65
python-version : 3.7
48
66
@@ -62,19 +80,41 @@ jobs:
62
80
lint :
63
81
runs-on : ubuntu-latest
64
82
steps :
65
- - name : checkout
66
- uses : actions/checkout@v2
67
-
68
- - name : Setup Python
69
- uses : actions/setup-python@v2
70
- with :
71
- python-version : 3.7
72
-
73
- - name : install black
74
- run : |
75
- python -m ensurepip
76
- pip install black
77
-
78
- - name : run linter
79
- run : |
80
- black twitchio --line-length 120 --verbose --check
83
+ - name : checkout
84
+ uses : actions/checkout@v4
85
+
86
+ - name : Setup Python
87
+ uses : actions/setup-python@v5
88
+ with :
89
+ python-version : 3.7
90
+
91
+ - name : install black
92
+ run : |
93
+ python -m ensurepip
94
+ pip install black
95
+
96
+ - name : run linter
97
+ run : |
98
+ black twitchio --line-length 120 --verbose --check
99
+
100
+ upload_pypi :
101
+ if : github.event_name == 'push' && github.ref_type == 'tag'
102
+ name : Publish built wheels to Pypi
103
+ runs-on : ubuntu-latest
104
+ environment : release
105
+ needs : [build, sdist]
106
+ permissions :
107
+ id-token : write
108
+
109
+ steps :
110
+ - uses : actions/download-artifact@v4
111
+
112
+ - name : Copy artifacts to dist/ folder
113
+ run : |
114
+ find . -name 'artifact-*' -exec unzip '{}' \;
115
+ mkdir -p dist/
116
+ find . -name '*.tar.gz' -exec mv '{}' dist/ \;
117
+ find . -name '*.whl' -exec mv '{}' dist/ \;
118
+
119
+ - uses : pypa/gh-action-pypi-publish@release/v1
120
+ name : Publish to PyPI
0 commit comments