diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ce9db84 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +on: push + +jobs: + test: + strategy: + matrix: + os: [ubuntu-18.04, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.6 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + + - name: Run tox + run: | + tox + + deploy: + runs-on: ubuntu-18.04 + needs: test + steps: + - uses: actions/checkout@v2 + - uses: actions/checkout@master + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.6 + + - name: Install dependencies + run: python -m pip install wheel twine setuptools + + - name: Build wheel + run: | + python setup.py sdist + + - name: Publish package if tagged release + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}