From aba975b76d5f9e91689f8bb057b6fd1556a6b775 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 9 Jan 2025 15:01:14 -0800 Subject: [PATCH 1/8] pyproject versioning --- .github/workflows/publish-to-test-pypi.yml | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/publish-to-test-pypi.yml diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 00000000..62b4a9de --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,77 @@ +name: Publish Python 🐍 distribution 📦 to TestPyPI + +on: + push + # 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/ From 5d74264b64ee28d7be0b26efdba3bbf54bb23fea Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 9 Jan 2025 15:01:33 -0800 Subject: [PATCH 2/8] pyproject versioning --- .github/workflows/publish-to-test-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 62b4a9de..38f69a4e 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -24,7 +24,7 @@ jobs: id: date run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT - name: Update version for nightly - if: github.event_name == 'schedule' + # if: github.event_name == 'schedule' run: | # Version is in pyproject.toml sed -i 's/version = "\([^"]*\)"/version = "\1.dev${{ steps.date.outputs.date }}"/' pyproject.toml From 45ef04a7ef92a40512677fa54d55d4ac4ba91f21 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 9 Jan 2025 15:04:32 -0800 Subject: [PATCH 3/8] test --- .github/workflows/publish-to-test-pypi.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 38f69a4e..1a450e72 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -2,14 +2,14 @@ name: Publish Python 🐍 distribution 📦 to TestPyPI on: push - # 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 + 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: From ee748949727edd324c1e1c641ba60a0a539ea912 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 9 Jan 2025 15:05:36 -0800 Subject: [PATCH 4/8] on push --- .github/workflows/publish-to-test-pypi.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 1a450e72..38f69a4e 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -2,14 +2,14 @@ name: Publish Python 🐍 distribution 📦 to TestPyPI on: push - 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 + # 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: From ef00ef76209e38d3f8ed2a0d1128a32b803914e6 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 9 Jan 2025 15:10:54 -0800 Subject: [PATCH 5/8] don't have it on push --- .github/workflows/publish-to-test-pypi.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 38f69a4e..ca324b6e 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,15 +1,14 @@ name: Publish Python 🐍 distribution 📦 to TestPyPI on: - push - # 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 + 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: @@ -24,7 +23,7 @@ jobs: id: date run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT - name: Update version for nightly - # if: github.event_name == 'schedule' + if: github.event_name == 'schedule' run: | # Version is in pyproject.toml sed -i 's/version = "\([^"]*\)"/version = "\1.dev${{ steps.date.outputs.date }}"/' pyproject.toml From b13567a6ebb06884304bce15ef3fbe707abb6102 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 9 Jan 2025 15:11:17 -0800 Subject: [PATCH 6/8] fix 0.0.63 --- src/llama_stack_client/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From e5044fd54cf8660312400add50ab046ab00f9d04 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 9 Jan 2025 15:12:24 -0800 Subject: [PATCH 7/8] test --- .github/workflows/publish-to-test-pypi.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index ca324b6e..b27b34ec 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,14 +1,15 @@ 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 + push + # 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: @@ -29,7 +30,7 @@ jobs: 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' + # 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 From 18d1409dfdc7935c63365a824f1b62ba981a5665 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Thu, 9 Jan 2025 15:15:04 -0800 Subject: [PATCH 8/8] back to prod --- .github/workflows/publish-to-test-pypi.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index b27b34ec..ca324b6e 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -1,15 +1,14 @@ name: Publish Python 🐍 distribution 📦 to TestPyPI on: - push - # 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 + 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: @@ -30,7 +29,7 @@ jobs: 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' + 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