Fix code formatting with prettier

Applied prettier formatting to workflow files and documentation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude
2025-10-25 02:12:05 +08:00
parent e317db5849
commit f11db63d3c
11 changed files with 86 additions and 53 deletions

View File

@@ -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 <commit-hash>
```
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

View File

@@ -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**