Deploy to PyPI #8
This file contains 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: Deploy to PyPI | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U setuptools wheel twine build | |
- name: Build | |
run: | | |
python -m build . | |
- name: Check that package version matches git tag ${{ github.ref_name }} | |
shell: bash | |
run: | | |
ls -l dist | |
test -f "dist/stardist_napari-${{ github.ref_name }}.tar.gz" | |
test -f "dist/stardist_napari-${{ github.ref_name }}-py3-none-any.whl" | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
twine upload --verbose dist/* |