Skip to content

Merge pull request #155 from andreaTP/implement-tryadd #26

Merge pull request #155 from andreaTP/implement-tryadd

Merge pull request #155 from andreaTP/implement-tryadd #26

Workflow file for this run

# This workflow publishes a distribution to PyPI when a commit is pushed to the main branch.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Publish to PyPI
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- name: Build
uses: ./.github/workflows/build.yml
publish:
name: Publish distribution to PyPI
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
environment: pypi_prod
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install flit
run: |
pip install flit
- name: Publish the distibution to PyPI
run: flit publish
env:
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }}