v2.2.1: Update MQTT dependencies #11
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
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Upload Python Package to PyPI | |
on: | |
# Allow manual dispatch | |
workflow_dispatch: | |
release: | |
types: [released] | |
jobs: | |
pypi-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get tags | |
run: git fetch --tags origin | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Get git tag version | |
run: echo git_tag=$(git describe --tags $(git rev-list --tags --max-count=1)) >> $GITHUB_ENV | |
- name: Get PyPI package version | |
run: echo pypi_version=$(python3 setup.py -V) >> $GITHUB_ENV | |
- name: Check for consistent versions | |
if: ${{ env.git_tag != env.pypi_version }} | |
run: | | |
echo Git Tag ${{ env.git_tag }} does not match PyPI version ${{ env.pypi_version }}. Canceling workflow. | |
exit 1 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build wheel | |
- name: Build package | |
run: python -m build | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
# Double check that versions match | |
if: ${{ env.git_tag == env.pypi_version }} | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |