1
1
name : Wheel Builder
2
2
on :
3
- repository_dispatch :
4
- types : [wheel-builder]
3
+ workflow_dispatch :
4
+ inputs :
5
+ version :
6
+ required : true
5
7
6
8
jobs :
7
9
manylinux :
@@ -15,21 +17,21 @@ jobs:
15
17
CONTAINER : " pyca/cryptography-manylinux1:x86_64"
16
18
- NAME : manylinux2010_x86_64
17
19
CONTAINER : " pyca/cryptography-manylinux2010:x86_64"
18
- name : " Python ${{ matrix.PYTHON }} for ${{ matrix.MANYLINUX.NAME }}"
20
+ name : " ${{ matrix.PYTHON }} for ${{ matrix.MANYLINUX.NAME }}"
19
21
steps :
20
22
- run : /opt/python/${{ matrix.PYTHON }}/bin/python -m virtualenv .venv
21
- - name : Downgrade pip, can't remember why
22
- run : .venv/bin/pip install -U pip==10.0.1
23
23
- name : Install Python dependencies
24
- run : .venv/bin/pip install cffi six ipaddress "enum34; python_version < '3'"
24
+ run : .venv/bin/pip install -U pip wheel cffi six ipaddress "enum34; python_version < '3'"
25
+ - run : .venv/bin/pip download cryptography==${{ github.event.inputs.version }} --no-deps --no-binary cryptography && tar zxvf cryptography*.tar.gz && mkdir tmpwheelhouse
25
26
- run : |
26
27
REGEX="cp3([0-9])*"
27
28
if [[ "${{ matrix.PYTHON }}" =~ $REGEX ]]; then
28
- PY_LIMITED_API="--build-option -- py-limited-api=cp3${BASH_REMATCH[1]}"
29
+ PY_LIMITED_API="--py-limited-api=cp3${BASH_REMATCH[1]}"
29
30
fi
31
+ cd cryptography*
30
32
LDFLAGS="-L/opt/pyca/cryptography/openssl/lib" \
31
33
CFLAGS="-I/opt/pyca/cryptography/openssl/include -Wl,--exclude-libs,ALL" \
32
- .venv/bin/pip wheel cryptography==${{ github.event.client_payload.BUILD_VERSION }} --no-binary cryptography --no-deps --wheel-dir= tmpwheelhouse $PY_LIMITED_API
34
+ ../. venv/bin/python setup.py bdist_wheel $PY_LIMITED_API && mv dist/ cryptography*.whl ../ tmpwheelhouse
33
35
- run : auditwheel repair --plat ${{ matrix.MANYLINUX.NAME }} tmpwheelhouse/cryptograph*.whl -w wheelhouse/
34
36
- run : unzip wheelhouse/*.whl -d execstack.check
35
37
- run : |
@@ -40,16 +42,14 @@ jobs:
40
42
else
41
43
exit 0
42
44
fi
43
- - name : Upgrade pip again so we can actually use manylinux2010
44
- run : .venv/bin/pip install -U pip
45
45
- run : .venv/bin/pip install cryptography --no-index -f wheelhouse/
46
46
- run : |
47
47
.venv/bin/python -c "from cryptography.hazmat.backends.openssl.backend import backend;print('Loaded: ' + backend.openssl_version_text());print('Linked Against: ' + backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii'))"
48
48
- run : mkdir cryptography-wheelhouse
49
49
- run : mv wheelhouse/cryptography*.whl cryptography-wheelhouse/
50
50
- uses : actions/upload-artifact@v1
51
51
with :
52
- name : " cryptography-${{ github.event.client_payload.BUILD_VERSION }}-${{ matrix.MANYLINUX.NAME }}-${{ matrix.PYTHON }}"
52
+ name : " cryptography-${{ github.event.inputs.version }}-${{ matrix.MANYLINUX.NAME }}-${{ matrix.PYTHON }}"
53
53
path : cryptography-wheelhouse/
54
54
55
55
macos :
65
65
ABI_VERSION : ' 3.5'
66
66
DOWNLOAD_URL : ' https://www.python.org/ftp/python/3.8.2/python-3.8.2-macosx10.9.pkg'
67
67
BIN_PATH : ' /Library/Frameworks/Python.framework/Versions/3.8/bin/python3'
68
- name : " Python ${{ matrix.PYTHON.VERSION }} for ABI ${{ matrix.PYTHON.ABI_VERSION }} on macOS"
68
+ name : " ${{ matrix.PYTHON.VERSION }} ABI ${{ matrix.PYTHON.ABI_VERSION }} macOS"
69
69
steps :
70
70
- uses : actions/checkout@master
71
71
- run : |
@@ -81,24 +81,20 @@ jobs:
81
81
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
82
82
83
83
- run : ${{ matrix.PYTHON.BIN_PATH }} -m virtualenv venv
84
- # Downgrade pip, I can't remember why
85
- - run : venv/bin/pip install -U pip==10.0.1
86
- - run : venv/bin/pip install -U wheel
87
- - run : venv/bin/pip install cffi six ipaddress "enum34; python_version < '3'"
88
-
84
+ - run : venv/bin/pip install -U pip wheel cffi six ipaddress "enum34; python_version < '3'"
85
+ - run : venv/bin/pip download cryptography==${{ github.event.inputs.version }} --no-deps --no-binary cryptography && tar zxvf cryptography*.tar.gz && mkdir wheelhouse
89
86
- name : Build the wheel
90
87
run : |
91
88
REGEX="3\.([0-9])*"
92
- if [[ "$PYTHON_VERSION " =~ $REGEX ]]; then
93
- PY_LIMITED_API="--build-option -- py-limited-api=cp3${BASH_REMATCH[1]}"
89
+ if [[ "${{ matrix.PYTHON.ABI_VERSION }} " =~ $REGEX ]]; then
90
+ PY_LIMITED_API="--py-limited-api=cp3${BASH_REMATCH[1]}"
94
91
fi
95
92
93
+ cd cryptography*
96
94
CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1" \
97
95
LDFLAGS="${HOME}/openssl-macos/lib/libcrypto.a ${HOME}/openssl-macos/lib/libssl.a" \
98
96
CFLAGS="-I${HOME}/openssl-macos/include -mmacosx-version-min=10.10 -march=core2" \
99
- venv/bin/pip wheel cryptography==${{ github.event.client_payload.BUILD_VERSION }} --wheel-dir=wheelhouse --no-binary cryptography --no-deps $PY_LIMITED_API
100
- env :
101
- PYTHON_VERSION : ${{ matrix.PYTHON.ABI_VERSION }}
97
+ ../venv/bin/python setup.py bdist_wheel $PY_LIMITED_API && mv dist/cryptography*.whl ../wheelhouse
102
98
- run : venv/bin/pip install -f wheelhouse --no-index cryptography
103
99
- run : |
104
100
venv/bin/python -c "from cryptography.hazmat.backends.openssl.backend import backend;print('Loaded: ' + backend.openssl_version_text());print('Linked Against: ' + backend._ffi.string(backend._lib.OPENSSL_VERSION_TEXT).decode('ascii'))"
@@ -107,7 +103,7 @@ jobs:
107
103
- run : mv wheelhouse/cryptography*.whl cryptography-wheelhouse/
108
104
- uses : actions/upload-artifact@v1
109
105
with :
110
- name : " cryptography-${{ github.event.client_payload.BUILD_VERSION }}-macOS-${{ matrix.PYTHON.ABI_VERSION }}"
106
+ name : " cryptography-${{ github.event.inputs.version }}-macOS-${{ matrix.PYTHON.ABI_VERSION }}"
111
107
path : cryptography-wheelhouse/
112
108
113
109
windows :
@@ -118,16 +114,17 @@ jobs:
118
114
- {ARCH: 'x86', WINDOWS: 'win32'}
119
115
- {ARCH: 'x64', WINDOWS: 'win64'}
120
116
PYTHON :
121
- - {VERSION: "2.7", TOXENV: "py27", MSVC_VERSION: "2010"}
122
- - {VERSION: "3.5", TOXENV: "py35", MSVC_VERSION: "2019"}
123
- - {VERSION: "3.6", TOXENV: "py36", MSVC_VERSION: "2019"}
124
- - {VERSION: "3.7", TOXENV: "py37", MSVC_VERSION: "2019"}
125
- - {VERSION: "3.8", TOXENV: "py38", MSVC_VERSION: "2019"}
126
- name : " Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"
117
+ - {VERSION: "2.7", MSVC_VERSION: "2010"}
118
+ - {VERSION: "3.5", MSVC_VERSION: "2019"}
119
+ - {VERSION: "3.6", MSVC_VERSION: "2019"}
120
+ - {VERSION: "3.7", MSVC_VERSION: "2019"}
121
+ - {VERSION: "3.8", MSVC_VERSION: "2019"}
122
+ - {VERSION: "3.8", MSVC_VERSION: "2019", "USE_ABI3": "true", "ABI_VERSION": "cp36"}
123
+ name : " ${{ matrix.PYTHON.VERSION }} ${{ matrix.WINDOWS.WINDOWS }} ${{ matrix.PYTHON.ABI_VERSION }}"
127
124
steps :
128
125
- uses : actions/checkout@master
129
126
- name : Setup python
130
- uses : actions/setup-python@v1
127
+ uses : actions/setup-python@v2
131
128
with :
132
129
python-version : ${{ matrix.PYTHON.VERSION }}
133
130
architecture : ${{ matrix.WINDOWS.ARCH }}
@@ -147,8 +144,13 @@ jobs:
147
144
env :
148
145
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
149
146
150
- - run : pip install cffi six ipaddress "enum34; python_version < '3'"
151
- - run : pip wheel cryptography==${{ github.event.client_payload.BUILD_VERSION }} --wheel-dir=wheelhouse --no-binary cryptography
147
+ - run : python -m pip install -U pip wheel cffi six ipaddress "enum34; python_version < '3'"
148
+ - run : pip download cryptography==${{ github.event.inputs.version }} --no-deps --no-binary cryptography && tar zxvf cryptography*.tar.gz && mkdir wheelhouse
149
+ shell : bash
150
+ - run : cd cryptography* && python setup.py bdist_wheel && mv dist/cryptography*.whl ../wheelhouse
151
+ if : matrix.PYTHON.USE_ABI3 != 'true'
152
+ - run : cd cryptography* && python setup.py bdist_wheel --py-limited-api=${{ matrix.PYTHON.ABI_VERSION }} && mv dist/cryptography*.whl ../wheelhouse
153
+ if : matrix.PYTHON.USE_ABI3 == 'true'
152
154
- run : pip install -f wheelhouse --no-index cryptography
153
155
- name : Print the OpenSSL we built and linked against
154
156
run : |
@@ -158,5 +160,5 @@ jobs:
158
160
- run : move wheelhouse\cryptography*.whl cryptography-wheelhouse\
159
161
- uses : actions/upload-artifact@v1
160
162
with :
161
- name : " cryptography-${{ github.event.client_payload.BUILD_VERSION }}-${{ matrix.WINDOWS.WINDOWS }}-${{ matrix.PYTHON.VERSION }}"
163
+ name : " cryptography-${{ github.event.inputs.version }}-${{ matrix.WINDOWS.WINDOWS }}-${{ matrix.PYTHON.VERSION }}-${{ matrix.PYTHON.ABI_VERSION }}"
162
164
path : cryptography-wheelhouse\
0 commit comments