pythonwheels.yml 3.4 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']
  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.3.3-manylinux2014_aarch64
  50. with:
  51. python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
  52. if: "matrix.os == 'ubuntu-latest'"
  53. - name: Build (Linux)
  54. uses: RalfG/python-wheels-manylinux-build@v0.3.1
  55. with:
  56. python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
  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. publish:
  63. runs-on: ${{ matrix.os }}
  64. strategy:
  65. matrix:
  66. os: [macos-latest, windows-latest]
  67. python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
  68. include:
  69. - os: ubuntu-latest
  70. python-version: '3.x'
  71. # path encoding
  72. fail-fast: false
  73. needs: build
  74. if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')
  75. steps:
  76. - name: Set up Python ${{ matrix.python-version }}
  77. uses: actions/setup-python@v2
  78. with:
  79. python-version: "3.x"
  80. - name: Install twine
  81. run: |
  82. python -m pip install --upgrade pip
  83. pip install twine
  84. - name: Publish (Linux)
  85. env:
  86. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  87. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  88. run: |
  89. # Only include *manylinux* wheels; the other wheels files are built but
  90. # rejected by pip.
  91. twine upload dist/*manylinux*.whl
  92. if: "matrix.os == 'ubuntu-latest'"
  93. - name: Publish (non-Linux)
  94. env:
  95. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  96. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  97. run: |
  98. twine upload dist/*.whl
  99. if: "matrix.os != 'ubuntu-latest'"