6
6
branches :
7
7
- develop
8
8
- main
9
+ tags :
10
+ - " *"
9
11
10
12
11
13
jobs :
42
44
run : tox -e docs
43
45
env :
44
46
PYTHON_ISAL_LINK_DYNAMIC : True
47
+ mypy :
48
+ needs : lint
49
+ runs-on : ubuntu-20.04
50
+ steps :
51
+
52
+ with :
53
+ submodules : recursive
54
+ - name : Set up Python 3.6
55
+
56
+ with :
57
+ python-version : 3.6
58
+ - name : Install isal
59
+ run : sudo apt-get install libisal-dev
60
+ - name : Install tox and upgrade setuptools and pip
61
+ run : pip install --upgrade tox setuptools pip
62
+ - name : Mypy checks
63
+ run : tox -e mypy
64
+ env :
65
+ PYTHON_ISAL_LINK_DYNAMIC : True
66
+ twine_check :
67
+ needs : lint
68
+ runs-on : ${{ matrix.os }}
69
+ strategy :
70
+ matrix :
71
+ python-version :
72
+ - 3.6
73
+ os : ["ubuntu-latest" ]
74
+ steps :
75
+
76
+ with :
77
+ submodules : recursive
78
+ - name : Set up Python ${{ matrix.python-version }}
79
+
80
+ with :
81
+ python-version : ${{ matrix.python-version }}
82
+ - name : Install build dependencies (Linux) # Yasm in pypa/manylinux images.
83
+ run : sudo apt install yasm
84
+ if : runner.os == 'Linux'
85
+ - name : Install build dependencies (Macos)
86
+ run : brew install yasm automake autoconf
87
+ if : runner.os == 'macOS'
88
+ - name : Install twine, cython wheel and upgrade setuptools
89
+ run : pip install --upgrade twine cython wheel setuptools
90
+ - name : create dists
91
+ run : python setup.py sdist bdist_wheel
92
+ - name : check dists
93
+ run : twine check dist/*
94
+
45
95
test-static :
46
96
needs : lint
47
97
runs-on : ${{ matrix.os }}
@@ -52,7 +102,10 @@ jobs:
52
102
- 3.7
53
103
- 3.8
54
104
- 3.9
55
- os : ["macos-latest", "ubuntu-latest", "windows-latest"]
105
+ os : ["ubuntu-latest"]
106
+ include :
107
+ - os : " macos-latest"
108
+ python-version : 3.8
56
109
steps :
57
110
58
111
with :
69
122
- name : Install build dependencies (Macos)
70
123
run : brew install yasm automake autoconf
71
124
if : runner.os == 'macOS'
72
- - name : Install build dependencies (Windows)
73
- run : choco install yasm visualstudio2019-workload-universalbuildtools
74
- if : runner.os == 'Windows'
75
125
- name : Run tests
76
126
run : tox -e py3
77
127
- name : Upload coverage report
84
134
matrix :
85
135
python-version :
86
136
- 3.6
87
- - 3.7
88
- - 3.8
89
- - 3.9
90
137
os : ["ubuntu-20.04"]
91
138
steps :
92
139
@@ -100,8 +147,52 @@ jobs:
100
147
run : sudo apt-get install libisal-dev
101
148
- name : Install tox and upgrade setuptools and pip
102
149
run : pip install --upgrade tox setuptools pip
103
-
104
150
- name : Run tests (dynamic link)
105
151
run : tox -e py3
106
152
env :
107
153
PYTHON_ISAL_LINK_DYNAMIC : True
154
+
155
+ deploy :
156
+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
157
+ runs-on : ${{ matrix.os }}
158
+ needs : [lint, docs, test-static, test-dynamic, twine_check]
159
+ strategy :
160
+ matrix :
161
+ os : [ "macos-latest", "ubuntu-latest" ]
162
+ steps :
163
+
164
+ with :
165
+ submodules : recursive
166
+ - uses : actions/setup-python@v2
167
+ name : Install Python
168
+ - name : Install cibuildwheel twine
169
+ run : python -m pip install cibuildwheel twine
170
+ - name : Install build dependencies (Macos)
171
+ run : brew install yasm automake autoconf
172
+ if : runner.os == 'macOS'
173
+ - name : Build wheels
174
+ run : cibuildwheel --output-dir dist
175
+ env :
176
+ CIBW_BUILD : " cp3{6,7,8,9}-*"
177
+ CIBW_SKIP : " *-win32 *-manylinux_i686" # Skip 32 bit.
178
+ CIBW_MANYLINUX_X86_64_IMAGE : " manylinux2014"
179
+ # Below command fails when data is not correctly statically linked
180
+ # Full tests not needed: these are done prior to building.
181
+ CIBW_TEST_COMMAND : " python -c 'from isal import isal_zlib, igzip; isal_zlib.adler32(b\" bla\" )'"
182
+ - name : Build sdist
183
+ if : " runner.os == 'Linux'"
184
+ run : python setup.py sdist
185
+ - name : Publish package to TestPyPI
186
+ # pypa/gh-action-pypi-publish@master does not work on OSX
187
+ # Alpha, Beta and dev releases contain a - in the tag.
188
+ if : contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')
189
+ run : twine upload --repository-url https://test.pypi.org/legacy/ dist/*
190
+ env :
191
+ TWINE_USERNAME : __token__
192
+ TWINE_PASSWORD : ${{ secrets.TEST_PYPI_API_TOKEN }}
193
+ - name : Publish package to PyPI
194
+ if : " !contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')"
195
+ run : twine upload dist/*
196
+ env :
197
+ TWINE_USERNAME : __token__
198
+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments