pythonwheels.yml 3.4 KB

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