Skip to content

Upload Python Package to PyPI #2

Upload Python Package to PyPI

Upload Python Package to PyPI #2

Workflow file for this run

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package to PyPI
on:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Create source distribution
run: python setup.py sdist
- name: Publish package
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
with:
skip-existing: true
user: __token__
password: ${{ secrets.PyPI_Publish }}
- name: Install package from PyPI
run: python -m pip install Corrfunc==${{ github.event.release.tag_name }}
- name: Verify installed version
run: |
export corrfunc_version=`python -c "import Corrfunc; print(Corrfunc.__version__)"`
echo "Installed Corrfunc version = ${corrfunc_version}"
echo "GitHub Release name = ${{ github.event.release.tag_name }}"
if [[ "$corrfunc_version" != "${{ github.event.release.tag_name }}" ]]; then exit 1; fi