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.
 
 
 
 
 

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