Skip to content

build

build #43

Workflow file for this run

name: build
on:
workflow_dispatch:
release:
types: [published]
env:
PY_VERSION: 3.12
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Setup Python $PY_VERSION
run: uv python install $PY_VERSION
- name: Build package
run: uv build
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: clinlp-build
path: dist
test-build:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Setup Python $PY_VERSION
run: uv python install $PY_VERSION
- name: Download build
uses: actions/download-artifact@v4
with:
name: clinlp-build
path: dist
- name: Create requirements file for test environment
run: |
uv export -o requirements.txt --only-group dev --no-hashes
find dist/*.whl | xargs -I {} echo {}"[transformers, metrics]" >> requirements.txt
- name: Test build
run: uv run --no-project --with-requirements requirements.txt pytest -n auto
publish:
needs: test-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Setup Python $PY_VERSION
run: uv python install $PY_VERSION
- name: Download build
uses: actions/download-artifact@v4
with:
name: clinlp-build
path: dist
- name: Publish package
run: uv publish --token ${{ SECRETS.PYPI_TOKEN }}