mirror of
https://github.com/deepseek-ai/deepseek-recipe.git
synced 2026-10-28 17:17:08 +08:00
ci: publish Python source distributions
This commit is contained in:
parent
8cadfede70
commit
a697e6281c
67
.github/workflows/publish-python-sdist.yml
vendored
Normal file
67
.github/workflows/publish-python-sdist.yml
vendored
Normal 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/
|
||||
Loading…
x
Reference in New Issue
Block a user