Skip to content

Commit d2f62cb

Browse files
authored
[CICD] testpypi workflow add repository_dispatch trigger from llama-stack (llamastack#81)
# What does this PR do? - add a workflow dispatch trigger for accepting repository_dispatch from llama-stack ## Test Plan - After merging to master, test with llama-stack workflow trigger ``` curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer PAT_TOKEN" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/meta-llama/llama-stack-client-python/dispatches \ -d '{"event_type":"build-client-package","client_payload":{"source":"llama-stack-nightly", "version": "rc234"}}' ``` ## Sources Please link relevant resources if necessary. ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [ ] Ran pre-commit to handle lint / formatting issues. - [ ] Read the [contributor guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md), Pull Request section? - [ ] Updated relevant documentation. - [ ] Wrote necessary unit or integration tests.
1 parent f6b2a31 commit d2f62cb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/publish-to-test-pypi.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: Publish Python 🐍 distribution 📦 to TestPyPI
22

33
on:
4+
repository_dispatch: # on trigger from llama-stack
5+
types: [build-client-package]
6+
47
workflow_dispatch: # Keep manual trigger
58
inputs:
69
rc_version:
710
description: 'RC version number (e.g., 1, 2, 3)'
811
required: true
912
type: string
13+
1014
schedule:
1115
- cron: "0 0 * * *" # Run every day at midnight
1216

@@ -33,6 +37,11 @@ jobs:
3337
run: |
3438
sed -i 's/version = "\([^"]*\)"/version = "\1rc${{ inputs.rc_version }}"/' pyproject.toml
3539
sed -i 's/__version__ = "\([^"]*\)"/__version__ = "\1rc${{ inputs.rc_version }}"/' src/llama_stack_client/_version.py
40+
- name: Update version for repository_dispatch
41+
if: github.event_name == 'repository_dispatch' && github.event.client_payload.source == 'llama-stack-nightly'
42+
run: |
43+
sed -i 's/version = "\([^"]*\)"/version = "\1${{ github.event.client_payload.version }}"/' pyproject.toml
44+
sed -i 's/__version__ = "\([^"]*\)"/__version__ = "\1${{ github.event.client_payload.version }}"/' src/llama_stack_client/_version.py
3645
- name: Set up Python
3746
uses: actions/setup-python@v5
3847
with:

0 commit comments

Comments
 (0)