Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CICD] github workflow to push nightly package to testpypi #734

Merged
merged 66 commits into from
Jan 11, 2025
Merged
Changes from 41 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
bc27343
test workflow
yanxi0830 Jan 9, 2025
074d856
test
yanxi0830 Jan 9, 2025
665c088
on workflow dispatch
yanxi0830 Jan 9, 2025
efb14c1
cleanup setup
yanxi0830 Jan 9, 2025
94d619b
nightly
yanxi0830 Jan 9, 2025
87e2cb8
test
yanxi0830 Jan 9, 2025
e855291
test
yanxi0830 Jan 9, 2025
c7becda
test
yanxi0830 Jan 9, 2025
a6e1740
test 0.0.64
yanxi0830 Jan 9, 2025
8ffdff1
rc?
yanxi0830 Jan 9, 2025
8640a30
rc?
yanxi0830 Jan 9, 2025
10b1360
remove hash
yanxi0830 Jan 9, 2025
3ce9601
nightly
yanxi0830 Jan 9, 2025
6c3b9fa
back to rc
yanxi0830 Jan 9, 2025
a45ce85
change schedule
yanxi0830 Jan 9, 2025
b8df87b
Add automatic PyPI release GitHub workflow (#618)
terrytangyuan Jan 9, 2025
45cf46e
rebase
yanxi0830 Jan 9, 2025
20dc186
test
yanxi0830 Jan 9, 2025
8527b79
test
yanxi0830 Jan 9, 2025
6202503
initial test
yanxi0830 Jan 10, 2025
16af87c
test trigger
yanxi0830 Jan 10, 2025
7ca2f5e
llama-stack-client-python
yanxi0830 Jan 10, 2025
ccd3ec1
test
yanxi0830 Jan 10, 2025
1988713
update requirements
yanxi0830 Jan 10, 2025
2644e09
bugfix
yanxi0830 Jan 10, 2025
df55ec6
fix
yanxi0830 Jan 10, 2025
0b0446f
fix
yanxi0830 Jan 10, 2025
d8c9798
test
yanxi0830 Jan 10, 2025
63232d7
remove double quotes
yanxi0830 Jan 10, 2025
cca2781
fix versions
yanxi0830 Jan 10, 2025
dc74675
add ver
yanxi0830 Jan 10, 2025
4387863
final workflow
yanxi0830 Jan 10, 2025
5f051b2
final workflow
yanxi0830 Jan 10, 2025
2847d70
remove dispatch on push
yanxi0830 Jan 10, 2025
1ea4666
add back requirements
yanxi0830 Jan 10, 2025
97d31d7
add back requirements
yanxi0830 Jan 10, 2025
7cdd8b9
trigger models build
yanxi0830 Jan 10, 2025
650016f
trigger models build
yanxi0830 Jan 10, 2025
7e57441
bugfix
yanxi0830 Jan 10, 2025
cbc2886
bugfix and add requirements
yanxi0830 Jan 10, 2025
c02b706
add back workflow dispatch
yanxi0830 Jan 10, 2025
dc9148b
replace w/ curl
yanxi0830 Jan 10, 2025
697df3e
tested, back to workflow_dispatch/schedule
yanxi0830 Jan 10, 2025
d9f14e2
instead of prefix, use full version
yanxi0830 Jan 10, 2025
0f7016a
instead of prefix, use full version
yanxi0830 Jan 10, 2025
de3161f
bugfix
yanxi0830 Jan 10, 2025
3df88b8
manual trigger
yanxi0830 Jan 10, 2025
cf673be
revert back
yanxi0830 Jan 10, 2025
74babf8
revert back
yanxi0830 Jan 10, 2025
f9c309d
Merge branch 'main' into testpypi-workflow
yanxi0830 Jan 10, 2025
5f04869
rebase & trigger a push
yanxi0830 Jan 10, 2025
58ed2d2
revert back
yanxi0830 Jan 10, 2025
74c6c9e
test simple cli
yanxi0830 Jan 10, 2025
0086734
test done
yanxi0830 Jan 10, 2025
5b8b809
test wait
yanxi0830 Jan 10, 2025
8366230
test wait
yanxi0830 Jan 11, 2025
00fa4ca
test wait
yanxi0830 Jan 11, 2025
6aaab0d
scheduled run
yanxi0830 Jan 11, 2025
9baedf6
better msg
yanxi0830 Jan 11, 2025
07bbfad
temp check
yanxi0830 Jan 11, 2025
285d8e1
back to prod
yanxi0830 Jan 11, 2025
99c7352
more robust workflow id
yanxi0830 Jan 11, 2025
040c643
back to prod
yanxi0830 Jan 11, 2025
ee80853
back to prod
yanxi0830 Jan 11, 2025
27be071
last test
yanxi0830 Jan 11, 2025
bef7e5b
prod
yanxi0830 Jan 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
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:
trigger-client-and-models-build:
name: Trigger llama-stack-client and llama-models build
runs-on: ubuntu-latest
steps:
- name: Get date
id: date
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Compute version based on dispatch event
id: version
run: |
# Read base version from pyproject.toml
if [ "${{ github.event_name }}" = "schedule" ]; then
echo "version=.dev${{ steps.date.outputs.date }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=rc${{ inputs.rc_version }}" >> $GITHUB_OUTPUT
else
echo "version=.dev$(shuf -i 10000000-99999999 -n 1)" >> $GITHUB_OUTPUT
yanxi0830 marked this conversation as resolved.
Show resolved Hide resolved
fi
- name: Trigger llama-stack-client workflow
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository: meta-llama/llama-stack-client-python
event-type: build-client-package
client-payload: '{"source": "llama-stack-nightly", "version": "${{ steps.version.outputs.version }}"}'
yanxi0830 marked this conversation as resolved.
Show resolved Hide resolved
- name: Trigger llama-models workflow
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository: meta-llama/llama-models
event-type: build-models-package
client-payload: '{"source": "llama-stack-nightly", "version": "${{ steps.version.outputs.version }}"}'
outputs:
version: ${{ steps.version.outputs.version }}

build:
name: Build distribution 📦
needs: trigger-client-and-models-build # Wait for client build to complete
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
run: |
sed -i 's/version="\([^"]*\)"/version="\1${{ needs.trigger-client-and-models-build.outputs.version }}"/' setup.py
sed -i 's/llama-stack-client>=\([^"]*\)/llama-stack-client==\1${{ needs.trigger-client-and-models-build.outputs.version }}/' requirements.txt
sed -i 's/llama-models>=\([^"]*\)/llama-models==\1${{ needs.trigger-client-and-models-build.outputs.version }}/' requirements.txt
- 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
yanxi0830 marked this conversation as resolved.
Show resolved Hide resolved
- 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

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/
Loading