diff --git a/.github/workflows/publish-python-sdist.yml b/.github/workflows/publish-python-sdist.yml new file mode 100644 index 0000000..6ed82ed --- /dev/null +++ b/.github/workflows/publish-python-sdist.yml @@ -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/