pythonwheels.yml 3.6 KB

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