chore: publish to pypi #26
Workflow file for this run
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: release | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| # include git history for setuptools-scm | |
| fetch-depth: 20 | |
| fetch-tags: true | |
| # work around a bug of checkout | |
| # https://github.com/actions/checkout/issues/1467 | |
| ref: ${{ github.ref }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| - name: build | |
| run: | | |
| python -m pip install build | |
| python -m build | |
| - name: dump result | |
| run: | | |
| ls -alh dist/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: ./dist/* | |
| - name: Publish to PyPI | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| skip-existing: true | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} |