mirror of
https://github.com/deepseek-ai/deepseek-recipe.git
synced 2026-10-28 17:17:08 +08:00
ci: publish Python source distribution
This commit is contained in:
parent
8cadfede70
commit
35d7647776
50
.github/workflows/publish-python-sdist.yml
vendored
Normal file
50
.github/workflows/publish-python-sdist.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Publish Python source distribution
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build source distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the release source
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build source distribution
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
command: sdist
|
||||
args: --manifest-path deepseek-recipe-python/Cargo.toml --out dist
|
||||
|
||||
- name: Store source distribution
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: python-sdist
|
||||
path: dist/*.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
publish:
|
||||
name: Publish source distribution to PyPI
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: pypi
|
||||
url: https://pypi.org/p/deepseek-recipe
|
||||
permissions:
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Download source distribution
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: python-sdist
|
||||
path: dist
|
||||
|
||||
- name: Publish package distributions
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
packages-dir: dist/
|
||||
@ -110,6 +110,24 @@ For an installation without editable development, use:
|
||||
python3 -m pip install ./deepseek-recipe-python
|
||||
```
|
||||
|
||||
## Source distribution
|
||||
|
||||
The release workflow publishes a source distribution alongside the wheels so
|
||||
`pip` has an artifact to build when no wheel matches the user's platform. To
|
||||
reproduce the source artifact locally:
|
||||
|
||||
```sh
|
||||
maturin sdist \
|
||||
--manifest-path deepseek-recipe-python/Cargo.toml \
|
||||
--out dist-sdist
|
||||
twine check dist-sdist/*
|
||||
```
|
||||
|
||||
The command packages the workspace crates and Python sources needed to build
|
||||
the extension. The PyPI publishing job uses trusted publishing and runs when a
|
||||
GitHub release is published; configure the `pypi` environment and the
|
||||
`deepseek-recipe` trusted publisher before the first release.
|
||||
|
||||
## Wheel packaging
|
||||
|
||||
The extension links OpenCV dynamically, so a wheel is only installable on a
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user