Skip to content

Add build pipeline and uv run script (#20) #33

Add build pipeline and uv run script (#20)

Add build pipeline and uv run script (#20) #33

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Build the package & run pytest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install the project
run: uv sync --all-extras --dev
- name: Run pytest
shell: bash -l {0}
run: uv run pytest
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/')
environment: pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Build the project
run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1