name: Upload Python Package

on:
  release:
    types: [published]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v1
      with:
        python-version: '3.x'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install setuptools wheel twine
    - name: Update keywords documentation
      run: |
        python -m robot.libdoc src/RequestsLibrary doc/RequestsLibrary.html
    - name: Commit updated documentation
      uses: stefanzweifel/git-auto-commit-action@dd055f6225757c369f948744463f63ac1bd4c277
      with:
        commit_message: Update keywords documentation
        file_pattern: doc/RequestsLibrary.html
    - name: Build and publish
      env:
        TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
        TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
      run: |
        python setup.py sdist bdist_wheel
        twine upload dist/*

name: Upload Python Package

on:
  release:
    types: [published]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v1
      with:
        python-version: '3.x'
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install setuptools wheel twine
    - name: Build
      run: |
        python setup.py sdist bdist_wheel
    - name: Update keywords documentation
      run: |
        python -m robot.libdoc src/RequestsLibrary doc/RequestsLibrary.html
    - name: Commit updated documentation
      uses: stefanzweifel/git-auto-commit-action@dd055f6225757c369f948744463f63ac1bd4c277
      with:
        commit_message: Update keywords documentation
        file_pattern: doc/RequestsLibrary.html
    - name: Publish to PyPi
      env:
        TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
        TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
      run: |
        twine upload dist/*

Build before generating the documentation
Build before generating the documentation
