Skip to content

Upload Python Package #79

Upload Python Package

Upload Python Package #79

Workflow file for this run

# This workflows 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
name: Upload Python Package
on:
workflow_dispatch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build the package
run: |
python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PIP_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PIP_PASSWORD }}
run: |
twine upload dist/*
- name: Tag and push new version
run: |
version_name=$(grep -m 1 version pyproject.toml | grep -Eo '[0-9]{1,}.[0-9]{1,}.[0-9]{1,}')
git config --global user.name "Tag Bot"
git config --global user.email "hello@cradl.ai"
git tag -a "$version_name" -m "Version $version_name"
git push origin "$version_name"