Add CLA workflow (#19) #33
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: Publish Python distros to PyPI + TestPyPI 📦 | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
branches: | |
- main | |
jobs: | |
build-n-publish: | |
name: Publish 📢 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Python 🐍 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install pipenv 🚂 | |
run: pipx install pipenv | |
- name: Install dependencies 🚅 | |
run: | | |
pipenv install --deploy --dev | |
- name: Check presidio_cli script 🚿 | |
run: | | |
pipenv run python -m presidio_cli --help | |
pipenv run presidio --help | |
- name: Run tests ⑇ | |
run: pipenv run pytest | |
- name: Install build/wheel/twine/setuptools 🚜 | |
run: | | |
pipenv install --dev build wheel setuptools twine | |
- name: Build a binary wheel and a source tarball ☕ | |
run: | | |
pipenv run python setup.py build check | |
pipenv run python -m build --sdist --wheel --outdir dist/ . | |
- name: Publish to TestPyPI 📦 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish to PyPI 📦 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |