Skip to content

update to allow local model cache for prediction #18

update to allow local model cache for prediction

update to allow local model cache for prediction #18

Workflow file for this run

name: Publish to PyPI
on:
push:
branches: [main]
paths:
- 'pyproject.toml'
workflow_dispatch:
inputs:
version:
description: 'Version to publish'
required: true
type: string
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
curl -LsSf https://astral.sh/uv/0.5.4/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
uv pip install --system -e ".[dev]"
- name: Lint
run: make lint-fix
check-version:
needs: build
runs-on: ubuntu-latest
outputs:
should_publish: ${{ steps.check.outputs.changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- id: check
run: |
CHANGED=$(git diff HEAD^ HEAD -- pyproject.toml | grep '+version' || true)
echo "changed=${CHANGED:+true}" >> $GITHUB_OUTPUT
public-pypi:
needs: [build, check-version]
if: needs.check-version.outputs.should_publish == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/0.5.4/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Build package
run: uv build
- name: Publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
uv build --no-sources
uv publish