Skip to content

Build fix

Build fix #92

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
# For the manual run.
workflow_dispatch:
push:
branches: [ master, releases ]
pull_request:
branches: [ master, releases ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.12.3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi
- name: MyPy types checking
run: |
mypy --config-file .mypy.ini markdown_toolset
- name: Lint with pylint
run: |
pylint -rn -sn --rcfile=.pylintrc --fail-on=I --load-plugins=pylint.extensions.docparams markdown_toolset
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
# TODO: --exit-zero - warnings as errors.
flake8 . --config .flake8 --count --show-source --statistics
- name: Test with pytest
run: |
pytest -v tests
- name: Install build dependencies
run: python -m pip install -U setuptools wheel build
- name: Build
run: python -m build .
# publish:
# runs-on: ubuntu-latest
#
# steps:
- name: Create new release
id: create_release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: juitnow/github-action-create-release@v1
env:
# This token is provided by Actions.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# Temporary fix.
release_name: Release 0.1.3
body: |
Release creating added to CI
draft: false
prerelease: false
- name: Publish package to the PyPI
# Already on push in the master branch.
# if: startsWith(github.head_ref, 'master')
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://upload.pypi.org/legacy/
skip_existing: true
print_hash: true