pythonpublish.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. fail-fast: false
  21. steps:
  22. - uses: actions/checkout@v2
  23. - name: Set up Python ${{ matrix.python-version }}
  24. uses: actions/setup-python@v2
  25. with:
  26. python-version: ${{ matrix.python-version }}
  27. - name: Install dependencies
  28. run: |
  29. python -m pip install --upgrade pip
  30. pip install setuptools wheel twine fastimport
  31. - name: Run test suite
  32. run: |
  33. python -m unittest dulwich.tests.test_suite
  34. - name: Build
  35. run: |
  36. python setup.py sdist bdist_wheel
  37. mkdir wheelhouse
  38. mv dist/*.whl wheelhouse
  39. if: "matrix.os != 'ubuntu-latest'"
  40. - name: Build and publish (Linux)
  41. uses: RalfG/python-wheels-manylinux-build@v0.2.2
  42. if: "matrix.os == 'ubuntu-latest'"
  43. - name: Publish (Linux)
  44. env:
  45. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  46. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  47. run: |
  48. twine upload wheelhouse/*manylinux*
  49. if: "matrix.os == 'ubuntu-latest'"
  50. - name: Publish
  51. env:
  52. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  53. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  54. run: |
  55. twine upload wheelhouse/*
  56. if: "matrix.os != 'ubuntu-latest'"