mirror of
https://github.com/trycua/computer.git
synced 2026-05-19 23:49:34 -05:00
Merge pull request #511 from r33drichards/feature/version-bump-workflows
Feature/version bump workflows
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
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
|
||||
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: Push changes
|
||||
run: |
|
||||
git push origin main --follow-tags
|
||||
@@ -111,6 +111,9 @@ ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Git worktrees
|
||||
.worktrees/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
+85
-54
@@ -349,67 +349,98 @@ For Swift code in the `libs/lume` directory:
|
||||
|
||||
## Releasing Packages
|
||||
|
||||
Cua uses `bump2version` to manage package versions across all Python modules. A Makefile is provided to simplify the release process.
|
||||
Cua uses an automated GitHub Actions workflow to bump package versions.
|
||||
|
||||
### Prerequisites
|
||||
> **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.
|
||||
|
||||
#### install `bump2version`
|
||||
### Version Bump Workflow
|
||||
|
||||
using brew
|
||||
All packages are managed through a single consolidated workflow: [Bump Version](https://github.com/trycua/cua/actions/workflows/bump-version.yml)
|
||||
|
||||
```
|
||||
brew install bumpversion
|
||||
```
|
||||
**Supported packages:**
|
||||
|
||||
### View Current Versions
|
||||
- cua-agent
|
||||
- cua-computer
|
||||
- cua-computer-server
|
||||
- cua-core
|
||||
- cua-mcp-server
|
||||
- cua-som
|
||||
- pylume
|
||||
|
||||
**How to use:**
|
||||
|
||||
1. Navigate to the [Bump Version workflow](https://github.com/trycua/cua/actions/workflows/bump-version.yml)
|
||||
2. Click the "Run workflow" button in the GitHub UI
|
||||
3. Select the **service/package** you want to bump from the first dropdown
|
||||
4. Select the **bump type** (patch/minor/major) from the second dropdown
|
||||
5. Click "Run workflow" to start the version bump
|
||||
6. The workflow will automatically commit changes and push to main
|
||||
|
||||
### Rolling Back a Version Bump
|
||||
|
||||
If you need to revert a version bump, follow these steps:
|
||||
|
||||
**Step 1: Find the version bump commit**
|
||||
|
||||
```bash
|
||||
# List recent commits
|
||||
git log --oneline | grep "Bump"
|
||||
|
||||
# Example output:
|
||||
# a1b2c3d Bump cua-core to v0.1.9
|
||||
```
|
||||
|
||||
**Step 2: Revert the commit**
|
||||
|
||||
```bash
|
||||
# Revert the specific commit
|
||||
git revert <commit-hash>
|
||||
|
||||
# Example:
|
||||
# git revert a1b2c3d
|
||||
```
|
||||
|
||||
**Step 3: Delete the git tag**
|
||||
|
||||
```bash
|
||||
# List tags to find the version tag
|
||||
git tag -l
|
||||
|
||||
# Delete the tag locally (use the correct package-specific format)
|
||||
git tag -d core-v0.1.9
|
||||
|
||||
# Delete the tag remotely
|
||||
git push origin :refs/tags/core-v0.1.9
|
||||
```
|
||||
|
||||
**Step 4: Push the revert**
|
||||
|
||||
```bash
|
||||
git push origin main
|
||||
```
|
||||
|
||||
**Per-package tag patterns:**
|
||||
|
||||
Each package uses its own tag format defined in `.bumpversion.cfg`:
|
||||
|
||||
- **cua-core**: `core-v{version}` (e.g., `core-v0.1.9`)
|
||||
- **cua-computer**: `computer-v{version}` (e.g., `computer-v0.4.7`)
|
||||
- **cua-agent**: `agent-v{version}` (e.g., `agent-v0.4.35`)
|
||||
- **cua-som**: `som-v{version}` (e.g., `som-v0.1.3`)
|
||||
- **pylume**: `pylume-v{version}` (e.g., `pylume-v0.2.1`)
|
||||
- **cua-computer-server**: `computer-server-v{version}` (e.g., `computer-server-v0.1.27`)
|
||||
- **cua-mcp-server**: `mcp-server-v{version}` (e.g., `mcp-server-v0.1.14`)
|
||||
|
||||
### Local Testing (Advanced)
|
||||
|
||||
The Makefile targets are kept for local testing only:
|
||||
|
||||
```bash
|
||||
# Test version bump locally (dry run)
|
||||
make dry-run-patch-core
|
||||
|
||||
# View current versions
|
||||
make show-versions
|
||||
```
|
||||
|
||||
### Bump Package Versions
|
||||
|
||||
To bump a specific package version:
|
||||
|
||||
```bash
|
||||
# Patch version bump (e.g., 0.1.8 → 0.1.9)
|
||||
make bump-patch-core # cua-core
|
||||
make bump-patch-pylume # pylume
|
||||
make bump-patch-computer # cua-computer
|
||||
make bump-patch-som # cua-som
|
||||
make bump-patch-agent # cua-agent
|
||||
make bump-patch-computer-server # cua-computer-server
|
||||
make bump-patch-mcp-server # cua-mcp-server
|
||||
|
||||
# Minor version bump (e.g., 0.1.8 → 0.2.0)
|
||||
make bump-minor-core # Replace 'core' with any package name
|
||||
|
||||
# Major version bump (e.g., 0.1.8 → 1.0.0)
|
||||
make bump-major-core # Replace 'core' with any package name
|
||||
```
|
||||
|
||||
### Dry Run (Test Before Bumping)
|
||||
|
||||
To preview changes without modifying files:
|
||||
|
||||
```bash
|
||||
make dry-run-patch-core # Test patch bump for cua-core
|
||||
make dry-run-minor-pylume # Test minor bump for pylume
|
||||
make dry-run-major-agent # Test major bump for cua-agent
|
||||
```
|
||||
|
||||
### Bump All Packages (Use with Caution)
|
||||
|
||||
```bash
|
||||
make bump-all-patch # Bumps patch version for ALL packages
|
||||
```
|
||||
|
||||
### After Bumping
|
||||
|
||||
After running any bump command, push your changes:
|
||||
|
||||
```bash
|
||||
git push origin main && git push origin --tags
|
||||
```
|
||||
|
||||
For more details, run `make help` or see the [Makefile](./Makefile).
|
||||
**Note:** For production releases, always use the GitHub Actions workflows above instead of running Makefile commands directly.
|
||||
|
||||
@@ -1,145 +1,19 @@
|
||||
# Python Package Release Makefile
|
||||
# This Makefile provides convenient targets for bumping versions of all Python packages
|
||||
# using bump2version. After running a target, remember to push: git push origin main
|
||||
# Version bumps are managed via GitHub Actions workflows (see Development.md)
|
||||
# This Makefile provides utility targets for checking versions and dry-run testing
|
||||
|
||||
.PHONY: help
|
||||
|
||||
help: ## Show this help message
|
||||
@echo "Python Package Release Automation"
|
||||
@echo "Python Package Release Utilities"
|
||||
@echo ""
|
||||
@echo "Usage: make <target>"
|
||||
@echo ""
|
||||
@echo "Available targets:"
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-25s %s\n", $$1, $$2}'
|
||||
@echo ""
|
||||
@echo "After bumping, push changes with: git push origin main"
|
||||
|
||||
# Core package targets
|
||||
bump-patch-core: ## Bump patch version of cua-core (0.1.8 → 0.1.9)
|
||||
@echo "Bumping cua-core patch version..."
|
||||
cd libs/python/core && bump2version patch
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-minor-core: ## Bump minor version of cua-core (0.1.8 → 0.2.0)
|
||||
@echo "Bumping cua-core minor version..."
|
||||
cd libs/python/core && bump2version minor
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-major-core: ## Bump major version of cua-core (0.1.8 → 1.0.0)
|
||||
@echo "Bumping cua-core major version..."
|
||||
cd libs/python/core && bump2version major
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
# Pylume package targets
|
||||
bump-patch-pylume: ## Bump patch version of pylume (0.2.2 → 0.2.3)
|
||||
@echo "Bumping pylume patch version..."
|
||||
cd libs/python/pylume && bump2version patch
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-minor-pylume: ## Bump minor version of pylume (0.2.2 → 0.3.0)
|
||||
@echo "Bumping pylume minor version..."
|
||||
cd libs/python/pylume && bump2version minor
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-major-pylume: ## Bump major version of pylume (0.2.2 → 1.0.0)
|
||||
@echo "Bumping pylume major version..."
|
||||
cd libs/python/pylume && bump2version major
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
# Computer package targets
|
||||
bump-patch-computer: ## Bump patch version of cua-computer (0.4.0 → 0.4.1)
|
||||
@echo "Bumping cua-computer patch version..."
|
||||
cd libs/python/computer && bump2version patch
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-minor-computer: ## Bump minor version of cua-computer (0.4.0 → 0.5.0)
|
||||
@echo "Bumping cua-computer minor version..."
|
||||
cd libs/python/computer && bump2version minor
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-major-computer: ## Bump major version of cua-computer (0.4.0 → 1.0.0)
|
||||
@echo "Bumping cua-computer major version..."
|
||||
cd libs/python/computer && bump2version major
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
# SOM package targets
|
||||
bump-patch-som: ## Bump patch version of cua-som (0.1.0 → 0.1.1)
|
||||
@echo "Bumping cua-som patch version..."
|
||||
cd libs/python/som && bump2version patch
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-minor-som: ## Bump minor version of cua-som (0.1.0 → 0.2.0)
|
||||
@echo "Bumping cua-som minor version..."
|
||||
cd libs/python/som && bump2version minor
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-major-som: ## Bump major version of cua-som (0.1.0 → 1.0.0)
|
||||
@echo "Bumping cua-som major version..."
|
||||
cd libs/python/som && bump2version major
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
# Agent package targets
|
||||
bump-patch-agent: ## Bump patch version of cua-agent (0.4.0 → 0.4.1)
|
||||
@echo "Bumping cua-agent patch version..."
|
||||
cd libs/python/agent && bump2version patch
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-minor-agent: ## Bump minor version of cua-agent (0.4.0 → 0.5.0)
|
||||
@echo "Bumping cua-agent minor version..."
|
||||
cd libs/python/agent && bump2version minor
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-major-agent: ## Bump major version of cua-agent (0.4.0 → 1.0.0)
|
||||
@echo "Bumping cua-agent major version..."
|
||||
cd libs/python/agent && bump2version major
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
# Computer Server package targets
|
||||
bump-patch-computer-server: ## Bump patch version of cua-computer-server (0.1.0 → 0.1.1)
|
||||
@echo "Bumping cua-computer-server patch version..."
|
||||
cd libs/python/computer-server && bump2version patch
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-minor-computer-server: ## Bump minor version of cua-computer-server (0.1.0 → 0.2.0)
|
||||
@echo "Bumping cua-computer-server minor version..."
|
||||
cd libs/python/computer-server && bump2version minor
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-major-computer-server: ## Bump major version of cua-computer-server (0.1.0 → 1.0.0)
|
||||
@echo "Bumping cua-computer-server major version..."
|
||||
cd libs/python/computer-server && bump2version major
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
# MCP Server package targets
|
||||
bump-patch-mcp-server: ## Bump patch version of cua-mcp-server (0.1.0 → 0.1.1)
|
||||
@echo "Bumping cua-mcp-server patch version..."
|
||||
cd libs/python/mcp-server && bump2version patch
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-minor-mcp-server: ## Bump minor version of cua-mcp-server (0.1.0 → 0.2.0)
|
||||
@echo "Bumping cua-mcp-server minor version..."
|
||||
cd libs/python/mcp-server && bump2version minor
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
bump-major-mcp-server: ## Bump major version of cua-mcp-server (0.1.0 → 1.0.0)
|
||||
@echo "Bumping cua-mcp-server major version..."
|
||||
cd libs/python/mcp-server && bump2version major
|
||||
@echo "✓ Done! Now run: git push origin main"
|
||||
|
||||
# Convenience targets for common workflows
|
||||
bump-all-patch: ## Bump patch version for ALL packages (use with caution!)
|
||||
@echo "⚠️ Bumping patch version for ALL packages..."
|
||||
@read -p "Are you sure? [y/N] " -n 1 -r; \
|
||||
echo; \
|
||||
if [[ $$REPLY =~ ^[Yy]$$ ]]; then \
|
||||
$(MAKE) bump-patch-core && \
|
||||
$(MAKE) bump-patch-pylume && \
|
||||
$(MAKE) bump-patch-computer && \
|
||||
$(MAKE) bump-patch-som && \
|
||||
$(MAKE) bump-patch-agent && \
|
||||
$(MAKE) bump-patch-computer-server && \
|
||||
$(MAKE) bump-patch-mcp-server; \
|
||||
fi
|
||||
@echo "⚠️ For production version bumps, use GitHub Actions:"
|
||||
@echo " https://github.com/trycua/cua/actions/workflows/bump-version.yml"
|
||||
|
||||
# Dry run targets (test without making changes)
|
||||
dry-run-patch-%: ## Dry run for patch version bump (e.g., make dry-run-patch-core)
|
||||
|
||||
Reference in New Issue
Block a user