pythonpublish.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Upload Python Package
  2. on:
  3. push:
  4. tags:
  5. - dulwich-*
  6. branches:
  7. - master
  8. jobs:
  9. deploy:
  10. runs-on: ${{ matrix.os }}
  11. strategy:
  12. matrix:
  13. os: [macos-latest, windows-latest]
  14. python-version: ['3.5', '3.6', '3.7', '3.8']
  15. include:
  16. - os: ubuntu-latest
  17. python-version: '3.x'
  18. # path encoding
  19. exclude:
  20. - os: windows-latest
  21. python-version: 3.5
  22. steps:
  23. - uses: actions/checkout@v2
  24. - name: Set up Python ${{ matrix.python-version }}
  25. uses: actions/setup-python@v2
  26. with:
  27. python-version: ${{ matrix.python-version }}
  28. - name: Install dependencies
  29. run: |
  30. python -m pip install --upgrade pip
  31. pip install setuptools wheel twine fastimport
  32. - name: Run test suite
  33. run: |
  34. python -m unittest dulwich.tests.test_suite
  35. - name: Build
  36. run: |
  37. python setup.py sdist bdist_wheel
  38. mkdir wheelhouse
  39. mv dist/*.whl wheelhouse
  40. if: "matrix.os != 'ubuntu-latest'"
  41. - name: Build and publish (Linux)
  42. uses: RalfG/python-wheels-manylinux-build@v0.2.2
  43. if: "matrix.os == 'ubuntu-latest'"
  44. - name: Publish
  45. env:
  46. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  47. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  48. run: |
  49. ls wheelhouse
  50. echo twine upload wheelhouse/*