pythonpublish.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. - name: Build and publish (Linux)
  41. uses: RalfG/python-wheels-manylinux-build@v0.3.1
  42. with:
  43. python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39'
  44. env:
  45. # Temporary fix for LD_LIBRARY_PATH issue. See
  46. # https://github.com/RalfG/python-wheels-manylinux-build/issues/26
  47. LD_LIBRARY_PATH: /usr/local/lib:${{ env.LD_LIBRARY_PATH }}
  48. if: "matrix.os == 'ubuntu-latest'"
  49. - name: Publish (Linux)
  50. env:
  51. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  52. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  53. run: |
  54. # Only include *manylinux* wheels; the other wheels files are built but
  55. # rejected by pip.
  56. twine upload dist/*manylinux*.whl
  57. if: "matrix.os == 'ubuntu-latest'"
  58. - name: Publish
  59. env:
  60. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  61. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  62. run: |
  63. twine upload dist/*.whl
  64. if: "matrix.os != 'ubuntu-latest'"