Skip to content

Commit f6b2a31

Browse files
authored
[CICD] llama-stack-client nightly package github workflow (#80)
# What does this PR do? - as title - https://test.pypi.org/manage/project/llama-stack-client/settings/publishing/ ## Test Plan <img width="1674" alt="image" src="https://github.com/user-attachments/assets/be015387-1a40-433e-8ef1-af2444734646" /> **Checking that the uploaded package have set version correctly** <img width="640" alt="image" src="https://github.com/user-attachments/assets/67991a51-0941-477a-b653-106fbcbb1450" /> ## 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 c8bdeb5 commit f6b2a31

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Publish Python 🐍 distribution 📦 to TestPyPI
2+
3+
on:
4+
workflow_dispatch: # Keep manual trigger
5+
inputs:
6+
rc_version:
7+
description: 'RC version number (e.g., 1, 2, 3)'
8+
required: true
9+
type: string
10+
schedule:
11+
- cron: "0 0 * * *" # Run every day at midnight
12+
13+
jobs:
14+
build:
15+
name: Build distribution 📦
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
persist-credentials: false
22+
- name: Get date
23+
id: date
24+
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
25+
- name: Update version for nightly
26+
if: github.event_name == 'schedule'
27+
run: |
28+
# Version is in pyproject.toml
29+
sed -i 's/version = "\([^"]*\)"/version = "\1.dev${{ steps.date.outputs.date }}"/' pyproject.toml
30+
sed -i 's/__version__ = "\([^"]*\)"/__version__ = "\1.dev${{ steps.date.outputs.date }}"/' src/llama_stack_client/_version.py
31+
- name: Update version for manual RC
32+
if: github.event_name == 'workflow_dispatch'
33+
run: |
34+
sed -i 's/version = "\([^"]*\)"/version = "\1rc${{ inputs.rc_version }}"/' pyproject.toml
35+
sed -i 's/__version__ = "\([^"]*\)"/__version__ = "\1rc${{ inputs.rc_version }}"/' src/llama_stack_client/_version.py
36+
- name: Set up Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: "3.11"
40+
- name: Install pypa/build
41+
run: >-
42+
python3 -m
43+
pip install
44+
build
45+
--user
46+
- name: Build a binary wheel and a source tarball
47+
run: python3 -m build
48+
- name: Store the distribution packages
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: python-package-distributions
52+
path: dist/
53+
54+
publish-to-testpypi:
55+
name: Publish Python 🐍 distribution 📦 to TestPyPI
56+
needs:
57+
- build
58+
runs-on: ubuntu-latest
59+
60+
environment:
61+
name: testrelease
62+
url: https://test.pypi.org/p/llama-stack-client
63+
64+
permissions:
65+
id-token: write # IMPORTANT: mandatory for trusted publishing
66+
67+
steps:
68+
- name: Download all the dists
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
- name: Publish distribution 📦 to TestPyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
repository-url: https://test.pypi.org/legacy/

src/llama_stack_client/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "llama_stack_client"
4-
__version__ = "0.0.1-alpha.0"
4+
__version__ = "0.0.63"

0 commit comments

Comments
 (0)