From f11db63d3c4c0585226b8edce3ff355ba742d5fb Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 25 Oct 2025 02:12:05 +0800 Subject: [PATCH] Fix code formatting with prettier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applied prettier formatting to workflow files and documentation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/bump-version-agent.yml | 6 +-- .../bump-version-computer-server.yml | 6 +-- .github/workflows/bump-version-computer.yml | 6 +-- .github/workflows/bump-version-core.yml | 6 +-- .github/workflows/bump-version-mcp-server.yml | 6 +-- .github/workflows/bump-version-pylume.yml | 6 +-- .github/workflows/bump-version-reusable.yml | 8 ++-- .github/workflows/bump-version-som.yml | 6 +-- Development.md | 17 +++++---- ...025-10-25-version-bump-workflows-design.md | 34 ++++++++++++----- .../2025-10-25-version-bump-workflows.md | 38 +++++++++++++------ 11 files changed, 86 insertions(+), 53 deletions(-) diff --git a/.github/workflows/bump-version-agent.yml b/.github/workflows/bump-version-agent.yml index 71f3b332..79774ca8 100644 --- a/.github/workflows/bump-version-agent.yml +++ b/.github/workflows/bump-version-agent.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" required: true type: choice options: @@ -16,7 +16,7 @@ jobs: bump: uses: ./.github/workflows/bump-version-reusable.yml with: - package_name: 'cua-agent' - package_directory: 'libs/python/agent' + package_name: "cua-agent" + package_directory: "libs/python/agent" bump_type: ${{ inputs.bump_type }} secrets: inherit diff --git a/.github/workflows/bump-version-computer-server.yml b/.github/workflows/bump-version-computer-server.yml index 0d2035c1..3ec09278 100644 --- a/.github/workflows/bump-version-computer-server.yml +++ b/.github/workflows/bump-version-computer-server.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" required: true type: choice options: @@ -16,7 +16,7 @@ jobs: bump: uses: ./.github/workflows/bump-version-reusable.yml with: - package_name: 'cua-computer-server' - package_directory: 'libs/python/computer-server' + package_name: "cua-computer-server" + package_directory: "libs/python/computer-server" bump_type: ${{ inputs.bump_type }} secrets: inherit diff --git a/.github/workflows/bump-version-computer.yml b/.github/workflows/bump-version-computer.yml index 5f1f709b..ec7c8b76 100644 --- a/.github/workflows/bump-version-computer.yml +++ b/.github/workflows/bump-version-computer.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" required: true type: choice options: @@ -16,7 +16,7 @@ jobs: bump: uses: ./.github/workflows/bump-version-reusable.yml with: - package_name: 'cua-computer' - package_directory: 'libs/python/computer' + package_name: "cua-computer" + package_directory: "libs/python/computer" bump_type: ${{ inputs.bump_type }} secrets: inherit diff --git a/.github/workflows/bump-version-core.yml b/.github/workflows/bump-version-core.yml index ff3302ff..f611272d 100644 --- a/.github/workflows/bump-version-core.yml +++ b/.github/workflows/bump-version-core.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" required: true type: choice options: @@ -16,7 +16,7 @@ jobs: bump: uses: ./.github/workflows/bump-version-reusable.yml with: - package_name: 'cua-core' - package_directory: 'libs/python/core' + package_name: "cua-core" + package_directory: "libs/python/core" bump_type: ${{ inputs.bump_type }} secrets: inherit diff --git a/.github/workflows/bump-version-mcp-server.yml b/.github/workflows/bump-version-mcp-server.yml index be367db9..8615f3db 100644 --- a/.github/workflows/bump-version-mcp-server.yml +++ b/.github/workflows/bump-version-mcp-server.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" required: true type: choice options: @@ -16,7 +16,7 @@ jobs: bump: uses: ./.github/workflows/bump-version-reusable.yml with: - package_name: 'cua-mcp-server' - package_directory: 'libs/python/mcp-server' + package_name: "cua-mcp-server" + package_directory: "libs/python/mcp-server" bump_type: ${{ inputs.bump_type }} secrets: inherit diff --git a/.github/workflows/bump-version-pylume.yml b/.github/workflows/bump-version-pylume.yml index 0651ba8c..499297f0 100644 --- a/.github/workflows/bump-version-pylume.yml +++ b/.github/workflows/bump-version-pylume.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" required: true type: choice options: @@ -16,7 +16,7 @@ jobs: bump: uses: ./.github/workflows/bump-version-reusable.yml with: - package_name: 'pylume' - package_directory: 'libs/python/pylume' + package_name: "pylume" + package_directory: "libs/python/pylume" bump_type: ${{ inputs.bump_type }} secrets: inherit diff --git a/.github/workflows/bump-version-reusable.yml b/.github/workflows/bump-version-reusable.yml index 9e0b5c47..fa7f432d 100644 --- a/.github/workflows/bump-version-reusable.yml +++ b/.github/workflows/bump-version-reusable.yml @@ -4,15 +4,15 @@ on: workflow_call: inputs: package_name: - description: 'Package display name (e.g., cua-core)' + description: "Package display name (e.g., cua-core)" required: true type: string package_directory: - description: 'Package directory relative to repo root (e.g., libs/python/core)' + description: "Package directory relative to repo root (e.g., libs/python/core)" required: true type: string bump_type: - description: 'Version bump type (patch, minor, or major)' + description: "Version bump type (patch, minor, or major)" required: true type: string @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: "3.11" - name: Install bump2version run: pip install bump2version diff --git a/.github/workflows/bump-version-som.yml b/.github/workflows/bump-version-som.yml index 1a6b6dbb..11abaa0a 100644 --- a/.github/workflows/bump-version-som.yml +++ b/.github/workflows/bump-version-som.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: bump_type: - description: 'Version bump type' + description: "Version bump type" required: true type: choice options: @@ -16,7 +16,7 @@ jobs: bump: uses: ./.github/workflows/bump-version-reusable.yml with: - package_name: 'cua-som' - package_directory: 'libs/python/som' + package_name: "cua-som" + package_directory: "libs/python/som" bump_type: ${{ inputs.bump_type }} secrets: inherit diff --git a/Development.md b/Development.md index 33f9a312..c9cb037a 100644 --- a/Development.md +++ b/Development.md @@ -355,17 +355,18 @@ Cua uses automated GitHub Actions workflows to bump package versions. Click the ### Version Bump Workflows -| Package | Workflow Link | -|---------|---------------| -| **cua-core** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-core.yml) | -| **cua-computer** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-computer.yml) | -| **cua-agent** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-agent.yml) | -| **cua-som** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-som.yml) | -| **pylume** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-pylume.yml) | +| Package | Workflow Link | +| ----------------------- | ------------------------------------------------------------------------------------------------ | +| **cua-core** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-core.yml) | +| **cua-computer** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-computer.yml) | +| **cua-agent** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-agent.yml) | +| **cua-som** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-som.yml) | +| **pylume** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-pylume.yml) | | **cua-computer-server** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-computer-server.yml) | -| **cua-mcp-server** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-mcp-server.yml) | +| **cua-mcp-server** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-mcp-server.yml) | **How to use:** + 1. Click the workflow link for the package you want to bump 2. Click the "Run workflow" button in the GitHub UI 3. Select the bump type from the dropdown (patch/minor/major) diff --git a/docs/plans/2025-10-25-version-bump-workflows-design.md b/docs/plans/2025-10-25-version-bump-workflows-design.md index f968cc25..06de3a75 100644 --- a/docs/plans/2025-10-25-version-bump-workflows-design.md +++ b/docs/plans/2025-10-25-version-bump-workflows-design.md @@ -23,6 +23,7 @@ Replace Makefile-based bump2version commands with GitHub Actions workflow_dispat **Rationale:** Follows GitHub Actions best practices, maintains DRY principle, easy to update core logic. **File Structure:** + ``` .github/workflows/ ├── bump-version-reusable.yml # Core reusable workflow @@ -42,14 +43,17 @@ Replace Makefile-based bump2version commands with GitHub Actions workflow_dispat **File:** `.github/workflows/bump-version-reusable.yml` **Inputs:** + - `package_name` (string): Display name (e.g., "cua-core") - `package_directory` (string): Path relative to repo root (e.g., "libs/python/core") - `bump_type` (string): patch/minor/major (passed from caller) **Permissions:** + - `contents: write` - Required to push commits and tags **Jobs:** + 1. **checkout**: Fetch repository with full history (needed for tags) 2. **setup-python**: Install Python 3.11+ 3. **install-bump2version**: Install via pip @@ -96,15 +100,15 @@ jobs: **Package-Specific Values:** -| Workflow File | package_name | package_directory | -|--------------|--------------|-------------------| -| bump-version-core.yml | cua-core | libs/python/core | -| bump-version-computer.yml | cua-computer | libs/python/computer | -| bump-version-agent.yml | cua-agent | libs/python/agent | -| bump-version-som.yml | cua-som | libs/python/som | -| bump-version-pylume.yml | pylume | libs/python/pylume | +| Workflow File | package_name | package_directory | +| -------------------------------- | ------------------- | --------------------------- | +| bump-version-core.yml | cua-core | libs/python/core | +| bump-version-computer.yml | cua-computer | libs/python/computer | +| bump-version-agent.yml | cua-agent | libs/python/agent | +| bump-version-som.yml | cua-som | libs/python/som | +| bump-version-pylume.yml | pylume | libs/python/pylume | | bump-version-computer-server.yml | cua-computer-server | libs/python/computer-server | -| bump-version-mcp-server.yml | cua-mcp-server | libs/python/mcp-server | +| bump-version-mcp-server.yml | cua-mcp-server | libs/python/mcp-server | ## Development.md Changes @@ -113,24 +117,29 @@ jobs: **New content includes:** 1. **Link table** with workflow_dispatch links for all packages: + ```markdown ### cua-core + - [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-core.yml) - Select patch/minor/major ### cua-computer + - [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-computer.yml) - Select patch/minor/major ... (continue for all 7 packages) ``` 2. **Branch Protection Note:** + ```markdown > **Note:** The main branch is currently not protected. If branch protection is enabled in the future, > the github-actions bot must be added to the bypass list for these workflows to commit directly. ``` 3. **Rollback Instructions:** - ```markdown + + ````markdown ### Rolling Back a Version Bump If you need to revert a version bump: @@ -139,13 +148,16 @@ jobs: ```bash git log --oneline | grep "Bump {package-name}" ``` + ```` 2. Revert the commit: + ```bash git revert ``` 3. Delete the tag locally and remotely: + ```bash # Find the tag (usually v{version}) git tag -l @@ -166,6 +178,9 @@ jobs: - cua-core: Look for tags like `v0.1.x` in `libs/python/core` - cua-computer: Look for tags like `v0.1.x` in `libs/python/computer` - etc. + + ``` + ``` ## Error Handling @@ -205,6 +220,7 @@ jobs: Keep the Makefile targets for local testing, but update Development.md to recommend GitHub Actions workflows as the primary method. **Makefile note to add:** + ```makefile # NOTE: For releases, prefer using GitHub Actions workflows (see Development.md) # These targets are kept for local testing only diff --git a/docs/plans/2025-10-25-version-bump-workflows.md b/docs/plans/2025-10-25-version-bump-workflows.md index 92392f9d..c8250dab 100644 --- a/docs/plans/2025-10-25-version-bump-workflows.md +++ b/docs/plans/2025-10-25-version-bump-workflows.md @@ -13,6 +13,7 @@ ## Task 1: Create Reusable Workflow **Files:** + - Create: `.github/workflows/bump-version-reusable.yml` **Step 1: Create the reusable workflow file** @@ -84,6 +85,7 @@ Expected: No syntax errors **Step 3: Verify structure** Check that: + - File has correct `workflow_call` trigger - All 3 inputs are defined (package_name, package_directory, bump_type) - Permissions include `contents: write` @@ -101,6 +103,7 @@ git commit -m "feat: add reusable bump version workflow" ## Task 2: Create Caller Workflow for cua-core **Files:** + - Create: `.github/workflows/bump-version-core.yml` **Step 1: Create the caller workflow file** @@ -141,6 +144,7 @@ Expected: No syntax errors **Step 3: Verify structure** Check that: + - File has `workflow_dispatch` trigger with bump_type input - Input type is `choice` with options: patch, minor, major - Job calls reusable workflow with correct path @@ -159,6 +163,7 @@ git commit -m "feat: add bump version workflow for cua-core" ## Task 3: Create Caller Workflow for cua-computer **Files:** + - Create: `.github/workflows/bump-version-computer.yml` **Step 1: Create the caller workflow file** @@ -206,6 +211,7 @@ git commit -m "feat: add bump version workflow for cua-computer" ## Task 4: Create Caller Workflow for cua-agent **Files:** + - Create: `.github/workflows/bump-version-agent.yml` **Step 1: Create the caller workflow file** @@ -253,6 +259,7 @@ git commit -m "feat: add bump version workflow for cua-agent" ## Task 5: Create Caller Workflow for cua-som **Files:** + - Create: `.github/workflows/bump-version-som.yml` **Step 1: Create the caller workflow file** @@ -300,6 +307,7 @@ git commit -m "feat: add bump version workflow for cua-som" ## Task 6: Create Caller Workflow for pylume **Files:** + - Create: `.github/workflows/bump-version-pylume.yml` **Step 1: Create the caller workflow file** @@ -347,6 +355,7 @@ git commit -m "feat: add bump version workflow for pylume" ## Task 7: Create Caller Workflow for cua-computer-server **Files:** + - Create: `.github/workflows/bump-version-computer-server.yml` **Step 1: Create the caller workflow file** @@ -394,6 +403,7 @@ git commit -m "feat: add bump version workflow for cua-computer-server" ## Task 8: Create Caller Workflow for cua-mcp-server **Files:** + - Create: `.github/workflows/bump-version-mcp-server.yml` **Step 1: Create the caller workflow file** @@ -441,6 +451,7 @@ git commit -m "feat: add bump version workflow for cua-mcp-server" ## Task 9: Update Development.md **Files:** + - Modify: `Development.md` (replace "Releasing Packages" section) **Step 1: Read the current Development.md** @@ -453,7 +464,7 @@ Expected: See current content about Makefile and bump2version Replace the entire "Releasing Packages" section (starting at line ~350) with: -```markdown +````markdown ## Releasing Packages Cua uses automated GitHub Actions workflows to bump package versions. Click the links below to trigger a version bump: @@ -462,17 +473,18 @@ Cua uses automated GitHub Actions workflows to bump package versions. Click the ### Version Bump Workflows -| Package | Workflow Link | -|---------|---------------| -| **cua-core** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-core.yml) | -| **cua-computer** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-computer.yml) | -| **cua-agent** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-agent.yml) | -| **cua-som** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-som.yml) | -| **pylume** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-pylume.yml) | +| Package | Workflow Link | +| ----------------------- | ------------------------------------------------------------------------------------------------ | +| **cua-core** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-core.yml) | +| **cua-computer** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-computer.yml) | +| **cua-agent** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-agent.yml) | +| **cua-som** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-som.yml) | +| **pylume** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-pylume.yml) | | **cua-computer-server** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-computer-server.yml) | -| **cua-mcp-server** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-mcp-server.yml) | +| **cua-mcp-server** | [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version-mcp-server.yml) | **How to use:** + 1. Click the workflow link for the package you want to bump 2. Click the "Run workflow" button in the GitHub UI 3. Select the bump type from the dropdown (patch/minor/major) @@ -492,6 +504,7 @@ git log --oneline | grep "Bump" # Example output: # a1b2c3d Bump version: 0.1.8 → 0.1.9 ``` +```` **Step 2: Revert the commit** @@ -523,6 +536,7 @@ git push origin main ``` **Per-package tag patterns:** + - All packages use tags like `v{version}` (e.g., `v0.1.9`, `v1.0.0`) - Each package's .bumpversion.cfg defines the exact tag format @@ -539,7 +553,8 @@ make show-versions ``` **Note:** For production releases, always use the GitHub Actions workflows above instead of running Makefile commands directly. -``` + +```` **Step 3: Verify the changes** @@ -552,13 +567,14 @@ Expected: See new content with workflow links table ```bash git add Development.md git commit -m "docs: update Development.md with version bump workflow links" -``` +```` --- ## Task 10: Add Note to Makefile (Optional) **Files:** + - Modify: `Makefile` **Step 1: Add deprecation note at the top of version bump section**