pythonpublish.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 dependencies
  30. run: |
  31. python -m pip install --upgrade pip
  32. pip install setuptools wheel twine fastimport
  33. - name: Run test suite
  34. run: |
  35. python -m unittest dulwich.tests.test_suite
  36. - name: Build
  37. run: |
  38. python setup.py sdist bdist_wheel
  39. if: "matrix.os != 'ubuntu-latest'"
  40. - uses: docker/setup-qemu-action@v1
  41. name: Set up QEMU
  42. if: "matrix.os == 'ubuntu-latest'"
  43. - name: Build and publish (Linux aarch64)
  44. uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2014_aarch64
  45. with:
  46. python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39'
  47. if: "matrix.os == 'ubuntu-latest'"
  48. - name: Build and publish (Linux)
  49. uses: RalfG/python-wheels-manylinux-build@v0.3.1
  50. with:
  51. python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39'
  52. env:
  53. # Temporary fix for LD_LIBRARY_PATH issue. See
  54. # https://github.com/RalfG/python-wheels-manylinux-build/issues/26
  55. LD_LIBRARY_PATH: /usr/local/lib:${{ env.LD_LIBRARY_PATH }}
  56. if: "matrix.os == 'ubuntu-latest'"
  57. - name: Publish (Linux)
  58. env:
  59. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  60. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  61. run: |
  62. # Only include *manylinux* wheels; the other wheels files are built but
  63. # rejected by pip.
  64. twine upload dist/*manylinux*.whl
  65. if: "matrix.os == 'ubuntu-latest'"
  66. - name: Publish
  67. env:
  68. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  69. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  70. run: |
  71. twine upload dist/*.whl
  72. if: "matrix.os != 'ubuntu-latest'"