Skip to content

2.1.1

2.1.1 #20

Workflow file for this run

name: release deployment
on:
release:
types:
- created
tags:
- '*.*.*'
jobs:
check:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: Check version in setup.py
run: |
TAG_REF=(${GITHUB_REF//\// })
TAG_REF=`echo "${TAG_REF[2]}" | tr -d '[:space:]'`
SETUP_PY_VERSION=`grep "version=" setup.py | cut -d '"' -f2 | tr -d '[:space:]'`
if [ "$SETUP_PY_VERSION" != "$TAG_REF" ]; then
echo "ERROR: setup.py contains version '$SETUP_PY_VERSION' which differs from '$TAG_REF'"
exit 1
fi
deploy:
needs: check
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*