Merge pull request #416 from mindsdb/staging #167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish to pypi | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: [3.8, 3.9] | |
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 dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements_test.txt | |
pip install --no-cache-dir -e .[test] | |
- name: Run unit tests | |
run: pytest | |
shell: bash | |
source-dist: | |
needs: test | |
runs-on: windows-latest | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: build wheel | |
run: | | |
pip install wheel | |
python setup.py bdist_wheel | |
- name: create source distribution | |
run: python setup.py sdist | |
- name: upload source distribution | |
run: | | |
pip install twine | |
twine upload dist/* |