Skip to content

Commit da651fa

Browse files
authored
Merge pull request #305 from skalenetwork/302-openssl-3-for-python-builds
Validate repaired t-encrypt wheel in workflows
2 parents 0c17ec6 + a8f1ee7 commit da651fa

2 files changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/publish.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
sudo apt-get update
4949
sudo apt-get install -y gawk sed shtool \
50-
libffi-dev yasm texinfo libgnutls28-dev gcc-multilib jq
50+
libffi-dev yasm texinfo libgnutls28-dev gcc-multilib jq patchelf
5151
- name: Build dependencies
5252
run: |
5353
export CC=gcc-11
@@ -159,24 +159,27 @@ jobs:
159159
CURRENT_VERSION="$(python setup_t_encrypt.py --version)"
160160
sed -i "s/${CURRENT_VERSION}/${PACKAGE_VERSION}/g" setup_t_encrypt.py
161161
python setup_t_encrypt.py sdist bdist_wheel
162-
wheel="$(ls -t dist/*.whl | head -n1)"
163-
[[ "${wheel}" != *-py3-none-any.whl ]] || \
164-
{ echo "Wheel bundling libencrypt.so must be platform-tagged: ${wheel}" >&2; exit 1; }
165-
auditwheel show "${wheel}"
162+
raw_wheel="$(ls -t dist/*.whl | head -n1)"
163+
[[ "${raw_wheel}" != *-py3-none-any.whl ]] || \
164+
{ echo "Wheel bundling libencrypt.so must be platform-tagged: ${raw_wheel}" >&2; exit 1; }
165+
auditwheel show "${raw_wheel}"
166+
auditwheel repair "${raw_wheel}" -w wheelhouse
167+
wheel="$(ls -t wheelhouse/*.whl | head -n1)"
168+
[[ "${wheel}" == *manylinux*.whl ]] || { echo "Repaired wheel must be manylinux-tagged: ${wheel}" >&2; exit 1; }
166169
python -m zipfile -e "${wheel}" wheel-check
167170
shared_library="wheel-check/t_encrypt/libencrypt.so"
168171
[[ -f "${shared_library}" ]] || { echo "libencrypt.so was not found in ${wheel}" >&2; exit 1; }
169172
! readelf -d "${shared_library}" | grep -Eq 'lib(ssl|crypto)\.so\.1\.1' || \
170173
{ echo "${shared_library} depends on OpenSSL 1.1" >&2; exit 1; }
171-
python -m twine check dist/*
174+
python -m twine check dist/*.tar.gz wheelhouse/*.whl
172175
173176
- name: Publish t-encrypt to PyPI
174177
working-directory: python
175178
env:
176179
TWINE_USERNAME: ${{ secrets.PIP_USERNAME }}
177180
TWINE_PASSWORD: ${{ secrets.PIP_PASSWORD }}
178181
run: |
179-
python -m twine upload dist/*
182+
python -m twine upload dist/*.tar.gz wheelhouse/*.whl
180183
181184
- name: Publish on npm
182185
if: github.ref != 'refs/heads/stable'

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ jobs:
214214
run: |
215215
sudo apt-get update
216216
sudo apt-get install -y gcc-11 g++-11 cmake gawk sed shtool \
217-
libffi-dev yasm texinfo libgnutls28-dev gcc-multilib git
218-
python -m pip install --upgrade pip setuptools wheel auditwheel
217+
libffi-dev yasm texinfo libgnutls28-dev gcc-multilib git patchelf
218+
python -m pip install --upgrade pip setuptools wheel auditwheel twine
219219
cd deps
220220
./build.sh
221221
cd ..
@@ -226,18 +226,22 @@ jobs:
226226
cd ../python
227227
export T_ENCRYPT_LIB_PATH="${GITHUB_WORKSPACE}/build/threshold_encryption/libt_encrypt_python.so"
228228
python setup_t_encrypt.py bdist_wheel
229-
wheel="$(ls -t dist/*.whl | head -n1)"
230-
[[ "${wheel}" != *-py3-none-any.whl ]] || { echo "Wheel must be platform-tagged: ${wheel}" >&2; exit 1; }
231-
auditwheel show "${wheel}"
229+
raw_wheel="$(ls -t dist/*.whl | head -n1)"
230+
[[ "${raw_wheel}" != *-py3-none-any.whl ]] || { echo "Wheel must be platform-tagged: ${raw_wheel}" >&2; exit 1; }
231+
auditwheel show "${raw_wheel}"
232+
auditwheel repair "${raw_wheel}" -w wheelhouse
233+
wheel="$(ls -t wheelhouse/*.whl | head -n1)"
234+
[[ "${wheel}" == *manylinux*.whl ]] || { echo "Repaired wheel must be manylinux-tagged: ${wheel}" >&2; exit 1; }
232235
python -m zipfile -e "${wheel}" wheel-check
233236
shared_library="wheel-check/t_encrypt/libencrypt.so"
234237
[[ -f "${shared_library}" ]]
235238
! readelf -d "${shared_library}" | grep -Eq 'lib(ssl|crypto)\.so\.1\.1'
239+
python -m twine check "${wheel}"
236240
- name: Upload t-encrypt wheel
237241
uses: actions/upload-artifact@v4
238242
with:
239243
name: t-encrypt-wheel
240-
path: python/dist/*.whl
244+
path: python/wheelhouse/*.whl
241245
validate_t_encrypt_wheel:
242246
needs: build_t_encrypt_wheel
243247
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)