setup: Update version to v0.1.5 #2
Workflow file for this run
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: 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: Build and Publish | |
uses: pypa/gh-action-pypi-publish@v1.8.10 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
distributions: "sdist bdist_wheel" |