2
0

pythonwheels.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. name: Build Python Wheels
  2. on:
  3. push:
  4. pull_request:
  5. schedule:
  6. - cron: "0 6 * * *" # Daily 6AM UTC build
  7. jobs:
  8. build:
  9. runs-on: ${{ matrix.os }}
  10. strategy:
  11. matrix:
  12. os: [macos-latest, windows-latest]
  13. python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-rc - 3.11"]
  14. architecture: ["x64", "x86"]
  15. include:
  16. - os: ubuntu-latest
  17. python-version: "3.x"
  18. # path encoding
  19. exclude:
  20. - os: macos-latest
  21. architecture: "x86"
  22. fail-fast: true
  23. steps:
  24. - uses: actions/checkout@v2
  25. - name: Set up Python ${{ matrix.python-version }}
  26. uses: actions/setup-python@v2
  27. with:
  28. python-version: ${{ matrix.python-version }}
  29. architecture: ${{ matrix.architecture }}
  30. - name: Install native dependencies (Ubuntu)
  31. run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
  32. if: "matrix.os == 'ubuntu-latest'"
  33. - name: Install native dependencies (MacOS)
  34. run: brew install swig gpgme
  35. if: "matrix.os == 'macos-latest'"
  36. - name: Install dependencies
  37. run: |
  38. python -m pip install --upgrade pip
  39. pip install setuptools wheel fastimport paramiko urllib3
  40. - name: Install gpg on supported platforms
  41. run: pip install -U gpg
  42. if: "matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'"
  43. - name: Run test suite
  44. run: |
  45. python -m unittest dulwich.tests.test_suite
  46. - name: Build
  47. run: |
  48. python setup.py sdist bdist_wheel
  49. if: "matrix.os != 'ubuntu-latest'"
  50. - uses: docker/setup-qemu-action@v1
  51. name: Set up QEMU
  52. if: "matrix.os == 'ubuntu-latest'"
  53. - name: Build (Linux aarch64)
  54. uses: RalfG/python-wheels-manylinux-build@v0.5.0-manylinux2014_aarch64
  55. with:
  56. python-versions: "cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311"
  57. if: "matrix.os == 'ubuntu-latest'"
  58. - name: Build (Linux)
  59. uses: RalfG/python-wheels-manylinux-build@v0.5.0
  60. with:
  61. python-versions: "cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311"
  62. env:
  63. # Temporary fix for LD_LIBRARY_PATH issue. See
  64. # https://github.com/RalfG/python-wheels-manylinux-build/issues/26
  65. LD_LIBRARY_PATH: /usr/local/lib:${{ env.LD_LIBRARY_PATH }}
  66. if: "matrix.os == 'ubuntu-latest'"
  67. - name: Upload wheels (Linux)
  68. uses: actions/upload-artifact@v2
  69. # Only include *manylinux* wheels; the other wheels files are built but
  70. # rejected by pip.
  71. if: "matrix.os == 'ubuntu-latest'"
  72. with:
  73. name: dist
  74. path: dist/*manylinux*.whl
  75. - name: Upload wheels (non-Linux)
  76. uses: actions/upload-artifact@v2
  77. with:
  78. name: dist
  79. path: dist/*.whl
  80. if: "matrix.os != 'ubuntu-latest'"
  81. publish:
  82. runs-on: ubuntu-latest
  83. needs: build
  84. if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')
  85. steps:
  86. - name: Set up Python
  87. uses: actions/setup-python@v2
  88. with:
  89. python-version: "3.x"
  90. - name: Install twine
  91. run: |
  92. python -m pip install --upgrade pip
  93. pip install twine
  94. - name: Download wheels
  95. uses: actions/download-artifact@v2
  96. - name: Publish wheels
  97. env:
  98. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  99. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  100. run: twine upload dist/*.whl