Skip to content

fix: python versions as string #3

fix: python versions as string

fix: python versions as string #3

name: Upload Python Package
on:
push:
branches:
- master
jobs:
build-n-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
- name: Running Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
pip install --only-binary=numpy,scipy numpy scipy
pip install -e .[test]
- name: Run tests
run: |
python -m PyEMD.tests.test_all
deploy:
# Run 'deploy' job only if `PyEMD/__init__.py` is modified
if: github.event_name == 'push' && contains(github.event.head_commit.modified, 'PyEMD/__init__.py')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.EMD_PYPI_API_TOKEN }}