2
0

pythonpublish.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. env:
  43. # Temporary fix for LD_LIBRARY_PATH issue. See
  44. # https://github.com/RalfG/python-wheels-manylinux-build/issues/26
  45. LD_LIBRARY_PATH: /usr/local/lib:${{ env.LD_LIBRARY_PATH }}
  46. if: "matrix.os == 'ubuntu-latest'"
  47. - name: Publish (Linux)
  48. env:
  49. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  50. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  51. run: |
  52. twine upload dist/*manylinux*
  53. if: "matrix.os == 'ubuntu-latest'"
  54. - name: Publish
  55. env:
  56. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  57. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  58. run: |
  59. twine upload wheelhouse/*
  60. if: "matrix.os != 'ubuntu-latest'"