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