Skip to content

Publish to PyPI

Publish to PyPI #17

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.32.0" RYE_INSTALL_OPTION="--yes" bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: Set up Rye
uses: eifinger/setup-rye@v3
- name: Patch Rye
run: |
echo "Patching Rye with Twine 5.1.1"
$RYE_HOME/self/bin/pip install twine==5.1.1
- name: Install dependencies
run: rye pin 3.10 && rye sync
- name: Build package
run: rye build --clean
- name: Publish to PyPI
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
echo $PYPI_PASSWORD
rye publish --username $PYPI_USERNAME --token $PYPI_PASSWORD --yes --verbose