pythonwheels.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: Build Python Wheels
  2. on:
  3. push:
  4. schedule:
  5. - cron: "0 6 * * *" # Daily 6AM UTC build
  6. jobs:
  7. build:
  8. runs-on: ${{ matrix.os }}
  9. strategy:
  10. matrix:
  11. os: [ubuntu-latest, macos-latest, windows-latest]
  12. fail-fast: true
  13. steps:
  14. - uses: actions/checkout@v3
  15. - uses: actions/setup-python@v3
  16. - name: Install native dependencies (Ubuntu)
  17. run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev
  18. if: "matrix.os == 'ubuntu-latest'"
  19. - name: Install native dependencies (MacOS)
  20. run: brew install swig gpgme
  21. if: "matrix.os == 'macos-latest'"
  22. - name: Install dependencies
  23. run: |
  24. python -m pip install --upgrade pip
  25. pip install setuptools wheel fastimport paramiko urllib3 cibuildwheel==2.9.0
  26. - name: Install gpg on supported platforms
  27. run: pip install -U gpg
  28. if: "matrix.os != 'windows-latest'"
  29. - name: Run test suite
  30. run: python -m unittest dulwich.tests.test_suite
  31. - name: Build wheels
  32. run: python -m cibuildwheel --output-dir wheelhouse
  33. - name: Upload wheels
  34. uses: actions/upload-artifact@v3
  35. with:
  36. path: ./wheelhouse/*.whl
  37. publish:
  38. runs-on: ubuntu-latest
  39. needs: build
  40. if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/dulwich-')
  41. steps:
  42. - uses: actions/setup-python@v3
  43. - name: Install twine
  44. run: |
  45. python -m pip install --upgrade pip
  46. pip install twine
  47. - name: Download wheels
  48. uses: actions/download-artifact@v2
  49. - name: Publish wheels
  50. env:
  51. TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
  52. TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
  53. run: twine upload dist/*.whl