pypi.yml 1.2 KB

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