-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(ci): unify PyPI/npm release workflow with dry-run support #4774
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
Conversation
Consolidate all llama-stack package publishing into a single workflow with support for manual testing and dry-run modes. Currently pypi.yml just builds, validates, and publishes llama-stack and llama-stack-api on schedule and release. If we truly want to move away from llama-stack-ops, we need to add client building+publishing as well Key changes: - Add workflow_dispatch trigger with configurable inputs: - dry_run: test-pypi (default), build-only, or off (production) - version: optional version override for RC builds - packages: all, llama-stack-only, or clients-only - client_ref: git ref for external client repos - Extend build matrix to include external client packages: - llama-stack-client-python (from llamastack/llama-stack-client-python) - llama-stack-client-typescript (from llamastack/llama-stack-client-typescript) - Merge publish-test-pypi and publish-pypi into single publish-packages job - Dynamically selects target registry based on dry_run and event type - Maintains max-parallel: 1 for correct dependency ordering - npm packages use npm pack for dry-run, npm publish for production - Add graceful degradation for missing secrets (RELEASE_PAT, NPM_TOKEN) - Warns and skips external packages if RELEASE_PAT not configured - Errors on npm production publish if NPM_TOKEN not configured - Add comprehensive header documentation explaining: - Required secrets and how to create them - All workflow inputs and their purposes - Publish flow and dependencies Publish behavior by trigger: - push/PR: build + test only - schedule: build + test + test.pypi.org - release: published: build + test + pypi.org + npm - workflow_dispatch: configurable via dry_run input Signed-off-by: Charlie Doern <cdoern@redhat.com>
45900e7 to
869cf3e
Compare
| options: | ||
| - 'test-pypi' # Publish to test.pypi.org (default for testing) | ||
| - 'build-only' # Build and validate only, no publishing anywhere | ||
| - 'off' # Production publish (use with caution!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
GITHUB_TOKEN should be fine, the client repos are public Signed-off-by: Charlie Doern <cdoern@redhat.com>
the typescript client doesnt have the proper files to use ci, use install Signed-off-by: Charlie Doern <cdoern@redhat.com>
and add explicit permissions to build-package job to satisfy code scanning, read only Signed-off-by: Charlie Doern <cdoern@redhat.com>
de21290 to
1706f6e
Compare
Add setuptools-scm to both pyproject.toml files with a fallback_version for environments without git (Docker, CI). Compute the publish version explicitly in the pypi workflow since version tags live on release branches, not main: nightlies get date-based dev versions, releases use the tag or manual input. Signed-off-by: Charlie Doern <cdoern@redhat.com>
1706f6e to
6a5de07
Compare
|
found some weird issues with our version tagging, I will fix it by properly tagging upon the next release using this action. We then can use setup tools auto versioning but until then we need the workflow in the most recent commit on this PR. |
Release events should always target production pypi.org and npm, not test.pypi.org. Remove the dry_run default that was overriding the release event logic. Signed-off-by: Charlie Doern <cdoern@redhat.com>
|
@Mergifyio backport release-0.4.x |
✅ Backports have been createdDetails
Cherry-pick of a840629 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
# What does this PR do? Consolidate all llama-stack package publishing into a single workflow with support for manual testing and dry-run modes. Currently pypi.yml just builds, validates, and publishes llama-stack and llama-stack-api on schedule and release. If we truly want to move away from llama-stack-ops, we need to add client building+publishing as well Key changes: - Add workflow_dispatch trigger with configurable inputs: - dry_run: test-pypi (default), build-only, or off (production) - version: optional version override for RC builds - packages: all, llama-stack-only, or clients-only - client_ref: git ref for external client repos - Extend build matrix to include external client packages: - llama-stack-client-python (from llamastack/llama-stack-client-python) - llama-stack-client-typescript (from llamastack/llama-stack-client-typescript) - Merge publish-test-pypi and publish-pypi into single publish-packages job - Dynamically selects target registry based on dry_run and event type - Maintains max-parallel: 1 for correct dependency ordering - npm packages use npm pack for dry-run, npm publish for production - Add graceful degradation for missing secrets (NPM_TOKEN) - Errors on npm production publish if NPM_TOKEN not configured - Add comprehensive header documentation explaining: - Required secrets and how to create them - All workflow inputs and their purposes - Publish flow and dependencies Publish behavior by trigger: - push/PR: build + test only - schedule: build + test + test.pypi.org - release: published: build + test + pypi.org + npm - workflow_dispatch: configurable via dry_run input ## Test Plan once merged, test dry-run workflow dispatch. --------- Signed-off-by: Charlie Doern <cdoern@redhat.com> (cherry picked from commit a840629) # Conflicts: # .github/workflows/README.md # pyproject.toml # src/llama_stack_api/pyproject.toml # uv.lock
Consolidate all llama-stack package publishing into a single workflow with support for manual testing and dry-run modes. Currently pypi.yml just builds, validates, and publishes llama-stack and llama-stack-api on schedule and release. If we truly want to move away from llama-stack-ops, we need to add client building+publishing as well Key changes: - Add workflow_dispatch trigger with configurable inputs: - dry_run: test-pypi (default), build-only, or off (production) - version: optional version override for RC builds - packages: all, llama-stack-only, or clients-only - client_ref: git ref for external client repos - Extend build matrix to include external client packages: - llama-stack-client-python (from llamastack/llama-stack-client-python) - llama-stack-client-typescript (from llamastack/llama-stack-client-typescript) - Merge publish-test-pypi and publish-pypi into single publish-packages job - Dynamically selects target registry based on dry_run and event type - Maintains max-parallel: 1 for correct dependency ordering - npm packages use npm pack for dry-run, npm publish for production - Add graceful degradation for missing secrets (NPM_TOKEN) - Errors on npm production publish if NPM_TOKEN not configured - Add comprehensive header documentation explaining: - Required secrets and how to create them - All workflow inputs and their purposes - Publish flow and dependencies Publish behavior by trigger: - push/PR: build + test only - schedule: build + test + test.pypi.org - release: published: build + test + pypi.org + npm - workflow_dispatch: configurable via dry_run input once merged, test dry-run workflow dispatch. --------- Signed-off-by: Charlie Doern <cdoern@redhat.com> (cherry picked from commit a840629) Signed-off-by: Charlie Doern <cdoern@redhat.com>
Consolidate all llama-stack package publishing into a single workflow with support for manual testing and dry-run modes. Currently pypi.yml just builds, validates, and publishes llama-stack and llama-stack-api on schedule and release. If we truly want to move away from llama-stack-ops, we need to add client building+publishing as well Key changes: - Add workflow_dispatch trigger with configurable inputs: - dry_run: test-pypi (default), build-only, or off (production) - version: optional version override for RC builds - packages: all, llama-stack-only, or clients-only - client_ref: git ref for external client repos - Extend build matrix to include external client packages: - llama-stack-client-python (from llamastack/llama-stack-client-python) - llama-stack-client-typescript (from llamastack/llama-stack-client-typescript) - Merge publish-test-pypi and publish-pypi into single publish-packages job - Dynamically selects target registry based on dry_run and event type - Maintains max-parallel: 1 for correct dependency ordering - npm packages use npm pack for dry-run, npm publish for production - Add graceful degradation for missing secrets (NPM_TOKEN) - Errors on npm production publish if NPM_TOKEN not configured - Add comprehensive header documentation explaining: - Required secrets and how to create them - All workflow inputs and their purposes - Publish flow and dependencies Publish behavior by trigger: - push/PR: build + test only - schedule: build + test + test.pypi.org - release: published: build + test + pypi.org + npm - workflow_dispatch: configurable via dry_run input once merged, test dry-run workflow dispatch. --------- Signed-off-by: Charlie Doern <cdoern@redhat.com> (cherry picked from commit a840629) Signed-off-by: Charlie Doern <cdoern@redhat.com>
Consolidate all llama-stack package publishing into a single workflow with support for manual testing and dry-run modes. Currently pypi.yml just builds, validates, and publishes llama-stack and llama-stack-api on schedule and release. If we truly want to move away from llama-stack-ops, we need to add client building+publishing as well Key changes: - Add workflow_dispatch trigger with configurable inputs: - dry_run: test-pypi (default), build-only, or off (production) - version: optional version override for RC builds - packages: all, llama-stack-only, or clients-only - client_ref: git ref for external client repos - Extend build matrix to include external client packages: - llama-stack-client-python (from llamastack/llama-stack-client-python) - llama-stack-client-typescript (from llamastack/llama-stack-client-typescript) - Merge publish-test-pypi and publish-pypi into single publish-packages job - Dynamically selects target registry based on dry_run and event type - Maintains max-parallel: 1 for correct dependency ordering - npm packages use npm pack for dry-run, npm publish for production - Add graceful degradation for missing secrets (NPM_TOKEN) - Errors on npm production publish if NPM_TOKEN not configured - Add comprehensive header documentation explaining: - Required secrets and how to create them - All workflow inputs and their purposes - Publish flow and dependencies Publish behavior by trigger: - push/PR: build + test only - schedule: build + test + test.pypi.org - release: published: build + test + pypi.org + npm - workflow_dispatch: configurable via dry_run input once merged, test dry-run workflow dispatch. --------- Signed-off-by: Charlie Doern <cdoern@redhat.com> (cherry picked from commit a840629) Signed-off-by: Charlie Doern <cdoern@redhat.com>
What does this PR do?
Consolidate all llama-stack package publishing into a single workflow with support for manual testing and dry-run modes.
Currently pypi.yml just builds, validates, and publishes llama-stack and llama-stack-api on schedule and release. If we truly want to move away from llama-stack-ops, we need to add client building+publishing as well
Key changes:
Add workflow_dispatch trigger with configurable inputs:
Extend build matrix to include external client packages:
Merge publish-test-pypi and publish-pypi into single publish-packages job
Add graceful degradation for missing secrets (NPM_TOKEN)
Add comprehensive header documentation explaining:
Publish behavior by trigger:
Test Plan
once merged, test dry-run workflow dispatch.