2
0

pythonpublish.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. mkdir wheelhouse
  40. mv dist/*.whl wheelhouse
  41. if: "matrix.os != 'ubuntu-latest'"
  42. - name: Build and publish (Linux)
  43. uses: RalfG/python-wheels-manylinux-build@v0.3.1
  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. twine upload wheelhouse/*manylinux*
  55. if: "matrix.os == 'ubuntu-latest'"
  56. - name: Publish
  57. env:
  58. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  59. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  60. run: |
  61. twine upload wheelhouse/*
  62. if: "matrix.os != 'ubuntu-latest'"