Skip to content

Make requests version a little bit more flexible #39

Make requests version a little bit more flexible

Make requests version a little bit more flexible #39

Workflow file for this run

name: Build
on:
# Run this workflow for pushes on all branches
push:
branches:
- '**'
# Run this workflow when a tag or branch is created
create:
# Run this workflow for pull requests
pull_request:
jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Check out repository
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 --upgrade poetry
poetry install
- name: Run tests
run: poetry run coverage run manage.py test --settings=test_settings
- name: Generate and send coveralls report
run: |
pip install --upgrade coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_to_pypi:
# Only run this job if the run_tests job has succeeded, and if
# this workflow was triggered by the creation of a new tag
needs: run_tests
if: github.event_name == 'create' && github.event.ref_type == 'tag' && github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build package and publish to PyPI
run: |
poetry build -f wheel
poetry build -f sdist
poetry publish -u "__token__" -p '${{ secrets.PYPI_OCS_AUTHENTICATION_API_TOKEN }}'