2
0

pythonpublish.yml 1.6 KB

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