mirror of
https://github.com/abetlen/llama-cpp-python.git
synced 2026-03-26 07:21:25 +00:00
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Publish to PyPI
|
|
|
|
# Based on: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
|
|
|
|
on: workflow_dispatch
|
|
|
|
jobs:
|
|
build-n-publish:
|
|
name: Build and publish
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: "recursive"
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.9"
|
|
|
|
- name: Install dependencies (Linux/MacOS)
|
|
if: runner.os != 'Windows'
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install uv
|
|
RUST_LOG=trace python -m uv pip install -e .[all] --verbose
|
|
python -m uv pip install build
|
|
shell: bash
|
|
|
|
- name: Install dependencies (Windows)
|
|
if: runner.os == 'Windows'
|
|
env:
|
|
RUST_LOG: trace
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install uv
|
|
python -m uv pip install -e .[all] --verbose
|
|
python -m uv pip install build
|
|
shell: cmd
|
|
|
|
- name: Build source distribution
|
|
run: |
|
|
python -m build --sdist
|
|
|
|
- name: Publish distribution to PyPI
|
|
# TODO: move to tag based releases
|
|
# if: startsWith(github.ref, 'refs/tags')
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|