name: build-wheels on: workflow_dispatch: branches: - master - extended jobs: many_linux_wheels: name: manylinux-wheels runs-on: ubuntu-latest container: quay.io/pypa/manylinux2014_x86_64 steps: - uses: actions/checkout@v2 - name: Print System Information run: | echo "uname -a: $( uname -a )" cat /etc/issue echo "Shell: $SHELL" echo "Mount points:"; mount echo "nproc: $( nproc )" env - name: Chose Python version run: | ln -s /opt/python/cp39-cp39/bin/python3 /usr/local/bin/python3 export PATH="/opt/python/cp39-cp39/bin:$PATH" - name: Install dependencies run: | yum install -y epel-release libxml2-devel libzstd-devel xz-devel bzip2-devel yum install -y libacl-devel openssl-devel yum install -y librichacl-devel swig strace - name: Install python tools run: | python3 -m pip install pytest auditwheel - name: Build libarchive C sources run: | git clone https://github.com/libarchive/libarchive.git libarchive-src cd libarchive-src; git checkout 3.5 mkdir build-libarchive; cd build-libarchive cmake ../ make -j$(nproc); make install cd ../.. - name: Compile pyhton modules run: | rm -rf build wheelhouse touch libarchive/_libarchive.i export LD_LIBRARY_PATH=/usr/local/lib64/:/usr/local/lib:$LD_LIBRARY_PATH export LIBARCHIVE_PREFIX=/usr/local python3 setup.py install - name: Build wheels run: | export LD_LIBRARY_PATH=/usr/local/lib64/:/usr/local/lib:$LD_LIBRARY_PATH export LIBARCHIVE_PREFIX=/usr/local python3 -m pip wheel --wheel-dir dist/ . auditwheel repair dist/*.whl python3 -m pip install --force-reinstall wheelhouse/*.whl - name: Mini test run: | cd /tmp strace -e open,openat python3 -c 'import libarchive; print(libarchive._libarchive.ARCHIVE_VERSION_STRING.split()[1])' \ | tee strace.out - name: version run: | export LD_LIBRARY_PATH=/usr/local/lib64/:/usr/local/lib:$LD_LIBRARY_PATH export LIBARCHIVE_PREFIX=/usr/local echo "::set-output name=version::$(cd /; python3 -c 'import libarchive; print(libarchive._libarchive.ARCHIVE_VERSION_STRING.split()[1])')" id: version - uses: actions/upload-artifact@v3 with: name: python_libarchive_ext-${{ steps.version.outputs.version }}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl path: ./wheelhouse/python_libarchive_ext-${{ steps.version.outputs.version }}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - name: release uses: actions/create-release@v1 id: create_release with: draft: false prerelease: false release_name: ${{ steps.version.outputs.version }} tag_name: ${{ github.ref }} env: GITHUB_TOKEN: ${{ github.token }} - name: upload artifact uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./wheelhouse/python_libarchive_ext-${{ steps.version.outputs.version }}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl asset_name: python_libarchive_ext-${{ steps.version.outputs.version }}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl asset_content_type: application/zip