pypi.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: PyPI
  2. on:
  3. push:
  4. branches:
  5. - master
  6. paths:
  7. - 'VERSION'
  8. workflow_dispatch:
  9. inputs:
  10. upload:
  11. description: 'Upload to PyPI'
  12. required: true
  13. type: boolean
  14. jobs:
  15. Test:
  16. runs-on: ubuntu-latest
  17. strategy:
  18. matrix:
  19. version: ['3.11']
  20. steps:
  21. - uses: actions/checkout@v4
  22. - uses: actions/setup-python@v5
  23. with:
  24. python-version: ${{ matrix.version }}
  25. - name: Test local builder
  26. run: |
  27. python -m python_appimage build local -p $(which python) \
  28. -d test.AppImage
  29. test -e test.AppImage
  30. Publish:
  31. needs: Test
  32. runs-on: ubuntu-latest
  33. if: github.ref == 'refs/heads/master'
  34. steps:
  35. - uses: actions/checkout@v4
  36. - uses: actions/setup-python@v5
  37. with:
  38. python-version: '3.11'
  39. - name: Build wheel
  40. run: |
  41. pip install -U pip
  42. pip install -U wheel
  43. python setup.py bdist_wheel --universal
  44. - name: Upload to PyPI
  45. if: (github.ref == 'refs/heads/master') && inputs.upload
  46. uses: pypa/gh-action-pypi-publish@master
  47. with:
  48. password: ${{ secrets.PYPI_TOKEN }}