feat/intial-v initial code #14
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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-n-publish: | |
name: Build and publish Python 🐍 distributions 📦 to PyPI | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if ! python -c "import twine" &> /dev/null; then | |
echo "twine not found, installing..." | |
pip install twine | |
fi | |
if ! python -c "import setuptools" &> /dev/null; then | |
echo "setuptools not found, installing..." | |
pip install setuptools | |
fi | |
- name: Build the package | |
run: python setup.py sdist | |
- name: List contents of dist directory | |
run: ls dist | |
- name: Publish the package | |
run: twine upload --repository-url https://upload.pypi.org/legacy/ -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/* |