Files
computer/.github/workflows/bump-version.yml
f-trycua 6ee76fbe15 Add comprehensive debugging for version passing between workflows
Added debug logging at every stage of version passing to identify
where the version parameter is being lost:

1. bump-version job: Verify agent_version output is set correctly
2. pypi-publish-agent prepare job: Show inputs.version and verify
   the get-version step output
3. pypi-reusable-publish: Already has debug showing empty version

Debug output will show:
- Event name and workflow trigger type
- Input version values at each stage
- Step output values
- Final version passed to reusable workflow

This will pinpoint exactly where the version parameter becomes empty
in the workflow_call chain.

Related: Previous debug showed "Expected version: " (empty)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 23:55:39 +01:00

123 lines
3.6 KiB
YAML

name: Bump Version
on:
workflow_dispatch:
inputs:
service:
description: "Service/Package to bump"
required: true
type: choice
options:
- cua-agent
- cua-computer
- cua-computer-server
- cua-core
- cua-mcp-server
- cua-som
- pylume
bump_type:
description: "Version bump type"
required: true
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
bump-version:
runs-on: ubuntu-latest
outputs:
agent_version: ${{ steps.agent_version.outputs.version }}
steps:
- name: Set package directory
id: package
run: |
case "${{ inputs.service }}" in
"cua-agent")
echo "directory=libs/python/agent" >> $GITHUB_OUTPUT
;;
"cua-computer")
echo "directory=libs/python/computer" >> $GITHUB_OUTPUT
;;
"cua-computer-server")
echo "directory=libs/python/computer-server" >> $GITHUB_OUTPUT
;;
"cua-core")
echo "directory=libs/python/core" >> $GITHUB_OUTPUT
;;
"cua-mcp-server")
echo "directory=libs/python/mcp-server" >> $GITHUB_OUTPUT
;;
"cua-som")
echo "directory=libs/python/som" >> $GITHUB_OUTPUT
;;
"pylume")
echo "directory=libs/python/pylume" >> $GITHUB_OUTPUT
;;
*)
echo "Unknown service: ${{ inputs.service }}"
exit 1
;;
esac
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install bump2version
run: pip install bump2version
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Run bump2version
run: |
cd ${{ steps.package.outputs.directory }}
bump2version ${{ inputs.bump_type }}
- name: Also bump cua-agent
if: ${{ inputs.service == 'cua-computer' }}
run: |
cd libs/python/agent
bump2version ${{ inputs.bump_type }}
- name: Capture bumped agent version
if: ${{ inputs.service == 'cua-agent' || inputs.service == 'cua-computer' }}
id: agent_version
run: |
cd libs/python/agent
VERSION=$(python -c "import tomllib; from pathlib import Path; data = tomllib.loads(Path('pyproject.toml').read_text()); print(data['project']['version'])")
echo "Agent version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Verify agent version output
if: ${{ inputs.service == 'cua-agent' || inputs.service == 'cua-computer' }}
run: |
echo "=== Bump Version Job Outputs ==="
echo "Agent version output: ${{ steps.agent_version.outputs.version }}"
- name: Push changes
run: |
git push origin main --follow-tags
publish-agent:
needs: bump-version
if: ${{ inputs.service == 'cua-agent' || inputs.service == 'cua-computer' }}
uses: ./.github/workflows/pypi-publish-agent.yml
with:
version: ${{ needs.bump-version.outputs.agent_version }}
secrets: inherit