pythonpublish.yml 1.3 KB

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