Publish both cua-agent and cua-computer when bumping cua-computer

This PR addresses two issues:

1. **Fix version detection in pypi-publish-computer workflow**
   - Updated to match the pattern from PR #598 for pypi-publish-agent
   - Check inputs.version first (works for workflow_call regardless of event_name)
   - Add debug output to help troubleshoot version detection issues
   - Proper handling of all three trigger types: workflow_call, workflow_dispatch, push

2. **Publish both packages when bumping cua-computer**
   - When bumping cua-computer, we bump both cua-computer and cua-agent versions
     (since cua-agent depends on cua-computer: "cua-computer>=0.4.0,<0.5.0")
   - Updated publish-agent job to trigger for both 'cua-agent' and 'cua-computer' services
   - This ensures version consistency between the two packages

**Behavior:**
- When bumping `cua-agent`: publishes cua-agent only
- When bumping `cua-computer`: publishes BOTH cua-computer AND cua-agent

This maintains version consistency and ensures users can install the latest
versions of both packages together without dependency conflicts.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
f-trycua
2025-11-19 19:51:30 +01:00
parent f1d6558188
commit 17d7140000
2 changed files with 24 additions and 6 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ jobs:
publish-agent:
needs: bump-version
if: ${{ inputs.service == 'cua-agent' }}
if: ${{ inputs.service == 'cua-agent' || inputs.service == 'cua-computer' }}
uses: ./.github/workflows/pypi-publish-agent.yml
with:
version: ${{ needs.bump-version.outputs.agent_version }}
+23 -5
View File
@@ -33,21 +33,39 @@ jobs:
- name: Determine version
id: get-version
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "=== Version Detection Debug ==="
echo "Event name: ${{ github.event_name }}"
echo "Workflow call version: ${{ inputs.version }}"
echo "Workflow dispatch version: ${{ github.event.inputs.version }}"
echo "GitHub ref: ${{ github.ref }}"
# Check inputs.version first (works for workflow_call regardless of event_name)
if [ -n "${{ inputs.version }}" ]; then
# Version provided via workflow_call or workflow_dispatch with version input
VERSION=${{ inputs.version }}
echo "Using inputs.version: $VERSION"
elif [ "${{ github.event_name }}" == "push" ]; then
# Extract version from tag (for package-specific tags)
if [[ "${{ github.ref }}" =~ ^refs/tags/computer-v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
VERSION=${BASH_REMATCH[1]}
echo "Extracted from tag: $VERSION"
else
echo "Invalid tag format for computer"
exit 1
fi
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
# Use version from workflow dispatch
elif [ -n "${{ github.event.inputs.version }}" ]; then
# Use version from workflow_dispatch event inputs
VERSION=${{ github.event.inputs.version }}
echo "Using event.inputs.version: $VERSION"
else
# Use version from workflow_call
VERSION=${{ inputs.version }}
echo "ERROR: No version found!"
echo " - inputs.version is empty"
echo " - event.inputs.version is empty"
echo " - Not a tag push event"
exit 1
fi
echo "=== Final Version ==="
echo "VERSION=$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT