diff --git a/actions/release-final-package/main.sh b/actions/release-final-package/main.sh index 03eb208..6a35d4b 100755 --- a/actions/release-final-package/main.sh +++ b/actions/release-final-package/main.sh @@ -100,20 +100,14 @@ set -x run_precommit_lockfile_update() { # Use pre-commit to update lockfiles (uv.lock and package-lock.json) # LLAMA_STACK_RELEASE_MODE=true signals hooks to update lockfiles - echo "Attempting to update lockfiles with pre-commit..." - for i in {1..5}; do - if LLAMA_STACK_RELEASE_MODE=true pre-commit run --all-files; then - echo "pre-commit lockfile update successful." - break - else - if [ "$i" -eq 5 ]; then - echo "pre-commit lockfile update failed after 5 attempts." >&2 - exit 1 - fi - echo "pre-commit lockfile update failed, retrying in 10 seconds (attempt $i/5)..." - sleep 10 - fi - done + # Note: pre-commit exits with non-zero when it modifies files, which is expected + if ! command -v pre-commit &> /dev/null; then + echo "ERROR: pre-commit is not installed" >&2 + exit 1 + fi + echo "Running pre-commit to update lockfiles..." + LLAMA_STACK_RELEASE_MODE=true pre-commit run --all-files || true + echo "pre-commit run completed." } add_bump_version_commit() { @@ -297,8 +291,9 @@ done echo "Release $RELEASE_VERSION published successfully" # Auto-bump main branch version (create PR) +# Only bump the stack repo, not client libraries if ! is_truthy "$LLAMA_STACK_ONLY"; then - echo "Creating PR to bump main branch version" + echo "Creating PR to bump main branch version for stack repo" # Calculate next dev version: 0.1.0 -> 0.1.1.dev0 MAJOR=$(echo $RELEASE_VERSION | cut -d. -f1) @@ -309,12 +304,13 @@ if ! is_truthy "$LLAMA_STACK_ONLY"; then echo "Next dev version: $NEXT_DEV_VERSION" - for repo in "${REPOS[@]}"; do + for repo in "stack"; do cd $TMPDIR if [ "$repo" != "stack-client-typescript" ]; then uv venv -p python3.12 bump-main-$repo-env source bump-main-$repo-env/bin/activate + uv pip install pre-commit fi cd llama-$repo diff --git a/actions/upload-packages-and-tag/main.sh b/actions/upload-packages-and-tag/main.sh index 6dd2648..cc71092 100755 --- a/actions/upload-packages-and-tag/main.sh +++ b/actions/upload-packages-and-tag/main.sh @@ -31,24 +31,17 @@ is_truthy() { run_precommit_lockfile_update() { # Use pre-commit to update lockfiles (uv.lock and package-lock.json) # For RC builds, LLAMA_STACK_RELEASE_MODE=true with UV config pointing to test.pypi - echo "Attempting to update lockfiles with pre-commit..." - for i in {1..5}; do - # Set UV config to use test.pypi as extra index for RC dependencies - if UV_EXTRA_INDEX_URL="https://test.pypi.org/simple/" \ - UV_INDEX_STRATEGY="unsafe-best-match" \ - LLAMA_STACK_RELEASE_MODE=true \ - pre-commit run --all-files; then - echo "pre-commit lockfile update successful." - break - else - if [ "$i" -eq 5 ]; then - echo "pre-commit lockfile update failed after 5 attempts." >&2 - exit 1 - fi - echo "pre-commit lockfile update failed, retrying in 10 seconds (attempt $i/5)..." - sleep 10 - fi - done + # Note: pre-commit exits with non-zero when it modifies files, which is expected + if ! command -v pre-commit &> /dev/null; then + echo "ERROR: pre-commit is not installed" >&2 + exit 1 + fi + echo "Running pre-commit to update lockfiles..." + UV_EXTRA_INDEX_URL="https://test.pypi.org/simple/" \ + UV_INDEX_STRATEGY="unsafe-best-match" \ + LLAMA_STACK_RELEASE_MODE=true \ + pre-commit run --all-files || true + echo "pre-commit run completed." } # Parse version to derive release branch name @@ -133,12 +126,23 @@ for repo in "${REPOS[@]}"; do cd .. done +# Push TypeScript tag immediately since it doesn't need lockfile updates +for repo in "${REPOS[@]}"; do + if [ "$repo" == "stack-client-typescript" ]; then + cd llama-$repo + org=$(github_org $repo) + echo "Pushing tag for llama-$repo (no lockfile updates needed)" + git push -f "https://x-access-token:${GITHUB_TOKEN}@github.com/$org/llama-$repo.git" "v$VERSION" + cd .. + fi +done + # Update lockfiles now that packages are published to test.pypi # Force-move tags to include lockfile updates echo "Updating lockfiles after publishing to test.pypi..." for repo in "${REPOS[@]}"; do if [ "$repo" == "stack-client-typescript" ]; then - # TypeScript client doesn't need lockfile updates + # TypeScript client doesn't need lockfile updates (already pushed above) continue fi @@ -164,9 +168,11 @@ for repo in "${REPOS[@]}"; do echo "No lockfile changes for $repo" fi - # Push tag (with force to update it) - echo "Pushing tag for llama-$repo" + # Push branch first (to ensure the commit exists on remote) + # Then push tag (which points to the commit) + echo "Pushing branch and tag for llama-$repo" org=$(github_org $repo) + git push -f "https://x-access-token:${GITHUB_TOKEN}@github.com/$org/llama-$repo.git" "$RELEASE_BRANCH" git push -f "https://x-access-token:${GITHUB_TOKEN}@github.com/$org/llama-$repo.git" "v$VERSION" cd ..