pypi.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: PyPI
  2. on:
  3. push:
  4. branches:
  5. - master
  6. paths:
  7. - 'python_appimage/version.py'
  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: Install Dependencies
  26. run: |
  27. sudo apt install -y desktop-file-utils
  28. pip install requests
  29. - name: Test local builder
  30. run: |
  31. python -m python_appimage build local -p $(which python) \
  32. -d test.AppImage
  33. test -e test.AppImage
  34. Publish:
  35. needs: Test
  36. runs-on: ubuntu-latest
  37. if: github.ref == 'refs/heads/master'
  38. steps:
  39. - uses: actions/checkout@v4
  40. - uses: actions/setup-python@v5
  41. with:
  42. python-version: '3.11'
  43. - name: Build wheel
  44. run: |
  45. pip install -U pip
  46. pip install -U wheel
  47. python setup.py bdist_wheel --universal
  48. - name: Upload to PyPI
  49. if: (github.ref == 'refs/heads/master') && inputs.upload
  50. uses: pypa/gh-action-pypi-publish@master
  51. with:
  52. password: ${{ secrets.PYPI_TOKEN }}