Skip to content

Publish to Pypi

Publish to Pypi #51

Workflow file for this run

name: Publish to Pypi
on:
workflow_dispatch:
inputs:
version:
description: 'Version upload to pypi'
required: true
pypi_repo:
description: 'Repo to upload to (testpypi or pypi)'
default: 'testpypi'
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -U wheelhouse_uploader pyyaml
- name: Downloading wheels and sdist from staging
uses: robinraju/release-downloader@v1.12
with:
repository: "Socrats/EGTtools"
latest: true
fileName: "*"
out-file-path: "dist/"
- name: Check that wheels exist
run: |
ls dist/*.whl || (echo "No wheels found!" && exit 1)
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
if: ${{ github.event.inputs.pypi_repo == 'testpypi' }}
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
if: ${{ github.event.inputs.pypi_repo == 'pypi' }}