Skip to content

v0.0.12

v0.0.12 #13

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [released]
jobs:
test_and_build:
# The type of runner that the job will run on
if: "!github.event.release.prerelease"
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", 3.11]
poetry-version: [1.8]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry ${{ matrix.poetry-version }}
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Set up cache
uses: actions/cache@v1
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install dependencies
run: poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --max-line-length=127 --show-source --statistics
- name: Run tests
run: |
poetry run pytest
- name: Build
run: poetry build
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: |
dist
gather_n_publish:
runs-on: ubuntu-latest
needs: test_and_build
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up Poetry 1.8
uses: abatilo/[email protected]
with:
poetry-version: 1.8
- name: Set up cache
uses: actions/cache@v1
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- uses: actions/download-artifact@v2
with:
name: wheels
path: dist/
- name: Set version from tag
run: poetry version $GITHUB_REF_NAME
- name: Install dependencies
run: |
poetry install
- name: Build sdist
run: poetry build -f sdist
- name: Display structure of downloaded files
run: ls -la
working-directory: dist/
- run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- name: Publish package
run: poetry publish --no-interaction -vvv
build_docs:
name: Build and deploy docs
runs-on: ubuntu-latest
needs: test_and_build
steps:
- name: Checkout main
uses: actions/checkout@v2
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
# Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: .config/mkdocs/mkdocs.yml
REQUIREMENTS: .config/mkdocs/requirements.txt
# EXTRA_PACKAGES: build-base