Unified cli (#86) #3
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: Publish Python 🐍 distributions 📦 to PyPI | |
on: | |
push: | |
tags: | |
- '*' # Trigger on any tagging event | |
jobs: | |
build-n-publish: | |
name: Build and publish Python 🐍 distributions 📦 to PyPI | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 # Updated to a specific version of the checkout action | |
with: | |
ref: main # Ensure it checks out the main branch | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.8' | |
- name: Install setuptools and wheel | |
run: python -m pip install setuptools wheel | |
- name: Extract tag name | |
id: tag | |
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3) | |
- name: Extract version from __init__.py | |
id: get_version | |
run: | | |
VERSION=$(grep '__version__' your_package/__init__.py | cut -d'"' -f2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Build a binary wheel | |
run: >- | |
python setup.py sdist bdist_wheel | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |