name: CI
on: [push, pull_request]
jobs:
  test:
    name: Test
    strategy:
      matrix:
        python-version: ['3.6.x', '3.7.x', '3.8.x']
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v1

    - name: Install Python
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}

    - name: Initialize environment
      run: |
        python -m pip install -U pip poetry
        poetry install

    - name: Run tests
      run: |
        poetry run flake8
        poetry run nosetests --with-coverage --cover-erase --cover-package=temba_client --cover-xml

    - name: Upload coverage
      if: success()
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        fail_ci_if_error: true

name: CI
on: [push, pull_request]
jobs:
  test:
    name: Test
    strategy:
      matrix:
        python-version: ['3.6.x', '3.7.x', '3.8.x']
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v1

    - name: Install Python
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}

    - name: Initialize environment
      run: |
        python -m pip install -U pip poetry
        poetry install

    - name: Run tests
      run: |
        poetry run flake8
        poetry run nosetests --with-coverage --cover-erase --cover-package=temba_client --cover-xml

    - name: Upload coverage
      if: success()
      uses: codecov/codecov-action@v1
      with:
        fail_ci_if_error: true

  release:
    name: Release
    needs: [ test ]
    if: startsWith(github.ref, 'refs/tags/')
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v1

      - name: Install Python
        uses: actions/setup-python@v1
        with:
          python-version: '3.8.x'

      - name: Publish release
        run: |
          python -m pip install -U pip poetry
          poetry build
          poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
          poetry publish

Add release job to github actions worflow
Add release job to github actions worflow
