ci: publish Python source distributions

This commit is contained in:
dvd233 2026-09-22 17:09:30 -07:00
parent 8cadfede70
commit a697e6281c
No known key found for this signature in database
GPG Key ID: FB6E3F753312D049

View File

@ -0,0 +1,67 @@
name: Publish Python source distribution
on:
release:
types: [published]
permissions:
contents: read
concurrency:
group: publish-python-sdist-${{ github.event.release.tag_name }}
cancel-in-progress: false
jobs:
build:
name: Build source distribution
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out the release commit
uses: actions/checkout@v7
with:
ref: ${{ github.event.release.tag_name }}
- name: Select the pinned Rust toolchain
run: rustup show active-toolchain
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install maturin
run: python -m pip install --disable-pip-version-check "maturin>=1.9,<2"
- name: Build the source distribution
run: maturin sdist --out dist --manifest-path deepseek-recipe-python/Cargo.toml
- name: Upload the source distribution
uses: actions/upload-artifact@v4
with:
name: deepseek-recipe-sdist
path: dist/*.tar.gz
if-no-files-found: error
retention-days: 7
publish:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: pypi
url: https://pypi.org/p/deepseek-recipe
permissions:
id-token: write
steps:
- name: Download the source distribution
uses: actions/download-artifact@v5
with:
name: deepseek-recipe-sdist
path: dist
- name: Publish the source distribution
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/