From 17d7140000b200a0210e2e4c10bf8e4e83b9b74f Mon Sep 17 00:00:00 2001 From: f-trycua Date: Wed, 19 Nov 2025 19:51:30 +0100 Subject: [PATCH] Publish both cua-agent and cua-computer when bumping cua-computer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/bump-version.yml | 2 +- .github/workflows/pypi-publish-computer.yml | 28 +++++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index c7104bd9..707bd3e5 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -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 }} diff --git a/.github/workflows/pypi-publish-computer.yml b/.github/workflows/pypi-publish-computer.yml index ea5d644b..c2dd4029 100644 --- a/.github/workflows/pypi-publish-computer.yml +++ b/.github/workflows/pypi-publish-computer.yml @@ -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