Skip to content

Build and publish package to PyPi #2

Build and publish package to PyPi

Build and publish package to PyPi #2

Workflow file for this run

name: Build and publish package to PyPi
on:
workflow_dispatch: {}
release:
types: [published]
jobs:
build_and_publish:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9, '3.10' ]
steps:
- uses: actions/checkout@v2
- name: ------------Set up Python ${{ matrix.python-version }}------------
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: ------------Install OpenMPI (Linux only)------------
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: ------------Build package------------
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository_url: https://upload.pypi.org/legacy/
- name: Deploy source code
if: github.event_name == 'release'
uses: actions/upload-artifact@v4
with:
name: source-code-${{ matrix.python-version }}
path: .