Create python-publish.yml #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Upload Python Package | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| release-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.8" | |
| - name: Build release distributions | |
| run: | | |
| pip3 install setuptools_rust | |
| pip3 install pytest | |
| python3 setup.py build | |
| pytest | |
| - name: Publish to Test PyPI | |
| run: | | |
| python3 setup.py sdist bdist_wheel &> package_setup.log | |
| curl --connect-timeout 10 -kI https://test.pypi.org | |
| twine upload -u ${{ secrets.USER }} -p ${{ secrets.PASS }} -r testpypi 'dist/*' | |
| - name: Publish to PyPI | |
| run: | | |
| python3 setup.py sdist bdist_wheel &> package_setup.log | |
| curl --connect-timeout 10 -kI https://test.pypi.org | |
| twine upload -u ${{ secrets.USER }} -p ${{ secrets.PASS }} 'dist/*' | |