diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..e6fbc99 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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/*