Skip to content

Deploy to PyPI

Deploy to PyPI #4

Workflow file for this run

name: Deploy to PyPI
on:
push:
tags:
- 'v*.*.*' # This will trigger the workflow only when a tag that matches the pattern is pushed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Check Tag and setup.py Version Match
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
SETUP_VERSION=$(grep -oE "version='([^']+)" setup.py | grep -oE "[^'=]+$")
if [[ "$TAG_VERSION" != "$SETUP_VERSION" ]]; then
echo "Tag version $TAG_VERSION does not match setup.py version $SETUP_VERSION."
exit 1
fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jinja2 setuptools wheel
generate/generate-python.py --output-dir=brping
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: .