switch to pyproject #1
Workflow file for this run
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: Publish python package | |
on: | |
push: | |
branches-ignore: | |
- '**' | |
tags: | |
- '**' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: | |
- 3.6 | |
- 3.7 | |
- 3.8 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Lint with flake8 | |
run: | | |
pip install flake8 | |
flake8 gql_query_builder/ --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 gql_query_builder/ --count --exit-zero --max-complexity=10 --max-line-length=256 --statistics | |
- name: Test | |
run: | | |
python -m unittest discover tests -v | |
publish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Init .pypirc | |
env: | |
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
echo -e '[pypi]' >> ~/.pypirc | |
echo -e "username = ${PYPI_USERNAME}" >> ~/.pypirc | |
echo -e "password = ${PYPI_PASSWORD}" >> ~/.pypirc | |
- name: Publish | |
run: | | |
pip install twine | |
python setup.py publish |