Skip to content

Commit

Permalink
Add GitHub action to deploy to PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
uschmidt83 committed Apr 4, 2022
1 parent da0b89e commit d3e062f
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy to PyPI

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
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/*

0 comments on commit d3e062f

Please sign in to comment.