Skip to content

Merge pull request #84 from icon-project/eunsoo-fix-eventmonitorspec #66

Merge pull request #84 from icon-project/eunsoo-fix-eventmonitorspec

Merge pull request #84 from icon-project/eunsoo-fix-eventmonitorspec #66

name: unittest and publish to pypi
on:
push:
branches: [master]
pull_request:
release:
types: [published]
jobs:
unittest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependency
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Run Test
run: |
python -m pytest -ra
deploy:
needs: unittest
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
cache: pip
- name: Install dependency
run: |
python -m pip install --upgrade pip
pip install wheel
echo "::notice:: pip list"
pip list
- name: Build package
id: build_package
run: |
python setup.py sdist bdist_wheel
echo "::notice:: ls -al dist"
ls -al dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}