pythonpublish.yml 2.7 KB

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