pythonpublish.yml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.5', '3.6', '3.7', '3.8', '3.9']
  13. include:
  14. - os: ubuntu-latest
  15. python-version: '3.x'
  16. # path encoding
  17. exclude:
  18. - os: windows-latest
  19. python-version: 3.5
  20. - os: macos-latest
  21. python-version: 3.5
  22. fail-fast: false
  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. - 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 twine fastimport
  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 and publish (Linux aarch64)
  53. uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2014_aarch64
  54. with:
  55. python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39'
  56. if: "matrix.os == 'ubuntu-latest'"
  57. - name: Build and publish (Linux)
  58. uses: RalfG/python-wheels-manylinux-build@v0.3.1
  59. with:
  60. python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39'
  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: Publish (Linux)
  67. env:
  68. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  69. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  70. run: |
  71. # Only include *manylinux* wheels; the other wheels files are built but
  72. # rejected by pip.
  73. twine upload dist/*manylinux*.whl
  74. if: "matrix.os == 'ubuntu-latest'"
  75. - name: Publish
  76. env:
  77. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  78. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  79. run: |
  80. twine upload dist/*.whl
  81. if: "matrix.os != 'ubuntu-latest'"