diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 00000000..ca324b6e --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,76 @@ +name: Publish Python 🐍 distribution 📦 to TestPyPI + +on: + workflow_dispatch: # Keep manual trigger + inputs: + rc_version: + description: 'RC version number (e.g., 1, 2, 3)' + required: true + type: string + schedule: + - cron: "0 0 * * *" # Run every day at midnight + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Get date + id: date + run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT + - name: Update version for nightly + if: github.event_name == 'schedule' + run: | + # Version is in pyproject.toml + sed -i 's/version = "\([^"]*\)"/version = "\1.dev${{ steps.date.outputs.date }}"/' pyproject.toml + sed -i 's/__version__ = "\([^"]*\)"/__version__ = "\1.dev${{ steps.date.outputs.date }}"/' src/llama_stack_client/_version.py + - name: Update version for manual RC + if: github.event_name == 'workflow_dispatch' + run: | + sed -i 's/version = "\([^"]*\)"/version = "\1rc${{ inputs.rc_version }}"/' pyproject.toml + sed -i 's/__version__ = "\([^"]*\)"/__version__ = "\1rc${{ inputs.rc_version }}"/' src/llama_stack_client/_version.py + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testrelease + url: https://test.pypi.org/p/llama-stack-client + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/src/llama_stack_client/_version.py b/src/llama_stack_client/_version.py index d4078242..e6be9c7e 100644 --- a/src/llama_stack_client/_version.py +++ b/src/llama_stack_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "llama_stack_client" -__version__ = "0.0.1-alpha.0" +__version__ = "0.0.63"