You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

109 lines
3.5 KiB

  1. name: build-wheels
  2. on:
  3. workflow_dispatch:
  4. branches:
  5. - master
  6. - extended
  7. jobs:
  8. many_linux_wheels:
  9. name: manylinux-wheels
  10. runs-on: ubuntu-latest
  11. container: quay.io/pypa/manylinux2014_x86_64
  12. steps:
  13. - uses: actions/checkout@v2
  14. - name: Print System Information
  15. run: |
  16. echo "uname -a: $( uname -a )"
  17. cat /etc/issue
  18. echo "Shell: $SHELL"
  19. echo "Mount points:"; mount
  20. echo "nproc: $( nproc )"
  21. env
  22. - name: Chose Python version
  23. run: |
  24. ln -s /opt/python/cp39-cp39/bin/python3 /usr/local/bin/python3
  25. export PATH="/opt/python/cp39-cp39/bin:$PATH"
  26. - name: Install dependencies
  27. run: |
  28. yum install -y epel-release libxml2-devel libzstd-devel xz-devel bzip2-devel
  29. yum install -y libacl-devel openssl-devel
  30. yum install -y librichacl-devel swig strace
  31. - name: Install python tools
  32. run: |
  33. python3 -m pip install pytest auditwheel
  34. - name: Build libarchive C sources
  35. run: |
  36. git clone https://github.com/libarchive/libarchive.git libarchive-src
  37. cd libarchive-src; git checkout 3.5
  38. mkdir build-libarchive; cd build-libarchive
  39. cmake ../
  40. make -j$(nproc); make install
  41. cd ../..
  42. - name: Compile pyhton modules
  43. run: |
  44. rm -rf build wheelhouse
  45. touch libarchive/_libarchive.i
  46. export LD_LIBRARY_PATH=/usr/local/lib64/:/usr/local/lib:$LD_LIBRARY_PATH
  47. export LIBARCHIVE_PREFIX=/usr/local
  48. python3 setup.py install
  49. - name: Build wheels
  50. run: |
  51. export LD_LIBRARY_PATH=/usr/local/lib64/:/usr/local/lib:$LD_LIBRARY_PATH
  52. export LIBARCHIVE_PREFIX=/usr/local
  53. python3 -m pip wheel --wheel-dir dist/ .
  54. auditwheel repair dist/*.whl
  55. python3 -m pip install --force-reinstall wheelhouse/*.whl
  56. - name: Mini test
  57. run: |
  58. cd /tmp
  59. strace -e open,openat python3 -c 'import libarchive; print(libarchive._libarchive.ARCHIVE_VERSION_STRING.split()[1])' \
  60. | tee strace.out
  61. - name: version
  62. run: |
  63. export LD_LIBRARY_PATH=/usr/local/lib64/:/usr/local/lib:$LD_LIBRARY_PATH
  64. export LIBARCHIVE_PREFIX=/usr/local
  65. echo "::set-output name=version::$(cd /; python3 -c 'import libarchive; print(libarchive._libarchive.ARCHIVE_VERSION_STRING.split()[1])')"
  66. id: version
  67. - uses: actions/upload-artifact@v3
  68. with:
  69. name: python_libarchive_ext-${{ steps.version.outputs.version }}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  70. path: ./wheelhouse/python_libarchive_ext-${{ steps.version.outputs.version }}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  71. - name: release
  72. uses: actions/create-release@v1
  73. id: create_release
  74. with:
  75. draft: false
  76. prerelease: false
  77. release_name: ${{ steps.version.outputs.version }}
  78. tag_name: ${{ github.ref }}
  79. env:
  80. GITHUB_TOKEN: ${{ github.token }}
  81. - name: upload artifact
  82. uses: actions/upload-release-asset@v1
  83. env:
  84. GITHUB_TOKEN: ${{ github.token }}
  85. with:
  86. upload_url: ${{ steps.create_release.outputs.upload_url }}
  87. asset_path: ./wheelhouse/python_libarchive_ext-${{ steps.version.outputs.version }}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  88. asset_name: python_libarchive_ext-${{ steps.version.outputs.version }}-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  89. asset_content_type: application/zip