Skip to content

8 plugin api

8 plugin api #63

Workflow file for this run

name: Main build and test workflow
# only on tagged commits or manual trigger or on change to main.yml
on:
pull_request:
types: [opened, synchronize, reopened]
push:
# tags:
# - '*'
# paths:
# - .github/workflows/**.yml
branches:
- main
tags:
- '*'
# on push to dev or main branch if tags are pushed
workflow_dispatch:
jobs:
Build:
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
python-version: ["3.11"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Clean up disk space
run: |
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /tmp/*
sudo rm -rf /var/tmp/*
df -h
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
pip install pytest
pip install -r requirements.txt
- name: Hatch build
run: |
hatch build
ls -l dist
- name: Install package and run tests
run: |
pip install dist/*.whl
pytest
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist
PyPI:
needs: Build
runs-on: ubuntu-latest
permissions:
id-token: write
if: startsWith(github.ref, 'refs/tags/')
environment:
name: pypi
url: https://pypi.org/project/poly-lithic/
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1