Skip to content

163 update missing type (#164) #10

163 update missing type (#164)

163 update missing type (#164) #10

name: Upload Python Package
on:
push:
branches:
- master
- ci-test
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
version-updated:
runs-on: ubuntu-latest
needs: build-n-test
outputs:
pyemd_version: ${{ steps.version.outputs.pyemd_version }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: version
with:
filters: |
pyemd_version:
- 'PyEMD/__init__.py'
- name: Check if version is updated
if: ${{ steps.version.outputs.pyemd_version == 'true'}}
run: echo "PyEMD version is updated"
- name: Check if version is not updated
if: ${{ steps.version.outputs.pyemd_version == 'false'}}
run: echo "PyEMD version is not updated"
deploy:
# Run 'deploy' job only if `PyEMD/__init__.py` is modified
if: needs.version-updated.outputs.pyemd_version == 'true'
needs: version-updated
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 }}