Skip to content

Version 0.6.4

Version 0.6.4 #466

Workflow file for this run

# This workflow will install Python dependencies, run tests, lint, build and deploy to PyPi
name: Build status
on:
push:
branches:
- main
- staging
- dev
pull_request:
branches:
- main
- staging
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
steps:
- 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 -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
python3 -m unittest discover -s tests
- name: Build package
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
run: python3 -m build
- name: Publish package to TestPyPI
if: github.event_name == 'push' && github.ref == 'refs/heads/staging'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
verbose: true
- name: Build package
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: python3 -m build
- name: Publish package
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true