Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

update workflow for cuabench

Dillon DuPont6183579bba8b
diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml
index 71e915501e..a530620efe 100644
--- a/.github/workflows/bump-version.yml
+++ b/.github/workflows/bump-version.yml
@@ -9,6 +9,7 @@ on:
type: choice
options:
- pypi/agent
+ - pypi/bench
- pypi/computer
- pypi/computer-server
- pypi/core
@@ -36,6 +37,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
agent_version: ${{ steps.agent_version.outputs.version }}
+ bench_version: ${{ steps.bench_version.outputs.version }}
computer_version: ${{ steps.computer_version.outputs.version }}
computer_server_version: ${{ steps.computer_server_version.outputs.version }}
core_version: ${{ steps.core_version.outputs.version }}
@@ -53,6 +55,10 @@ jobs:
echo "directory=libs/python/agent" >> $GITHUB_OUTPUT
echo "type=python" >> $GITHUB_OUTPUT
;;
+ "pypi/bench")
+ echo "directory=libs/cua-bench" >> $GITHUB_OUTPUT
+ echo "type=python" >> $GITHUB_OUTPUT
+ ;;
"pypi/computer")
echo "directory=libs/python/computer" >> $GITHUB_OUTPUT
echo "type=python" >> $GITHUB_OUTPUT
@@ -159,6 +165,15 @@ jobs:
echo "Agent version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
+ - name: Capture bumped bench version
+ if: ${{ inputs.service == 'pypi/bench' }}
+ id: bench_version
+ run: |
+ cd libs/cua-bench
+ VERSION=$(python -c "import tomllib; from pathlib import Path; data = tomllib.loads(Path('pyproject.toml').read_text()); print(data['project']['version'])")
+ echo "Bench version: $VERSION"
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
+
- name: Capture bumped computer version
if: ${{ inputs.service == 'pypi/computer' }}
id: computer_version
@@ -251,6 +266,14 @@ jobs:
version: ${{ needs.bump-version.outputs.agent_version }}
secrets: inherit
+ publish-bench:
+ needs: bump-version
+ if: ${{ inputs.service == 'pypi/bench' }}
+ uses: ./.github/workflows/pypi-publish-bench.yml
+ with:
+ version: ${{ needs.bump-version.outputs.bench_version }}
+ secrets: inherit
+
publish-computer-server:
needs: bump-version
if: ${{ inputs.service == 'pypi/computer-server' }}
diff --git a/.github/workflows/pypi-publish-bench.yml b/.github/workflows/pypi-publish-bench.yml
new file mode 100644
index 0000000000..4847d74faa
--- /dev/null
+++ b/.github/workflows/pypi-publish-bench.yml
@@ -0,0 +1,78 @@
+name: Publish Bench Package
+
+on:
+ push:
+ tags:
+ - "bench-v*"
+ workflow_dispatch:
+ inputs:
+ version:
+ description: "Version to publish (without v prefix)"
+ required: true
+ default: "0.1.0"
+ workflow_call:
+ inputs:
+ version:
+ description: "Version to publish"
+ required: true
+ type: string
+
+# Adding permissions at workflow level
+permissions:
+ contents: write
+
+jobs:
+ prepare:
+ runs-on: ubuntu-latest
+ outputs:
+ version: ${{ steps.get-version.outputs.version }}
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Determine version
+ id: get-version
+ run: |
+ if [ "${{ github.event_name }}" == "push" ]; then
+ # Extract version from tag (for package-specific tags)
+ if [[ "${{ github.ref }}" =~ ^refs/tags/bench-v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
+ VERSION=${BASH_REMATCH[1]}
+ else
+ echo "Invalid tag format for bench"
+ exit 1
+ fi
+ elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
+ # Use version from workflow dispatch
+ VERSION=${{ github.event.inputs.version }}
+ else
+ # Use version from workflow_call
+ VERSION=${{ inputs.version }}
+ fi
+ echo "VERSION=$VERSION"
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
+
+ publish:
+ needs: prepare
+ uses: ./.github/workflows/pypi-reusable-publish.yml
+ with:
+ package_name: "bench"
+ package_dir: "libs/cua-bench"
+ version: ${{ needs.prepare.outputs.version }}
+ is_lume_package: false
+ base_package_name: "cua-bench"
+ secrets:
+ PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
+
+ create-release:
+ needs: [prepare, publish]
+ uses: ./.github/workflows/github-release-reusable.yml
+ with:
+ tag_name: "bench-v${{ needs.prepare.outputs.version }}"
+ release_name: "cua-bench v${{ needs.prepare.outputs.version }}"
+ body: |
+ ## Toolkit for computer-use RL environments and benchmarks
+
+ ## Installation
+
+ ```bash
+ pip install cua-bench==${{ needs.prepare.outputs.version }}
+ ```
diff --git a/libs/cua-bench/.bumpversion.cfg b/libs/cua-bench/.bumpversion.cfg
index f5800addcb..4d99a58a4e 100644
--- a/libs/cua-bench/.bumpversion.cfg
+++ b/libs/cua-bench/.bumpversion.cfg
@@ -2,8 +2,8 @@
current_version = 0.1.0
commit = True
tag = True
-tag_name = v{new_version}
-message = chore: bump version to {new_version}
+tag_name = bench-v{new_version}
+message = chore: bump cua-bench version to {new_version}
[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
diff --git a/libs/cua-bench/.github/workflows/bump-version.yml b/libs/cua-bench/.github/workflows/bump-version.yml
deleted file mode 100644
index 6ca2357575..0000000000
--- a/libs/cua-bench/.github/workflows/bump-version.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-name: Bump Version & Publish
-
-on:
- workflow_dispatch:
- inputs:
- bump_type:
- description: "Version bump type"
- required: true
- type: choice
- options:
- - patch
- - minor
- - major
- publish:
- description: "Publish to PyPI after bumping"
- required: false
- type: boolean
- default: true
-
-permissions:
- contents: write
-
-jobs:
- bump-version:
- runs-on: ubuntu-latest
- outputs:
- version: ${{ steps.capture_version.outputs.version }}
- steps:
- - 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: |
- bump2version ${{ inputs.bump_type }}
-
- - name: Capture bumped version
- id: capture_version
- run: |
- VERSION=$(python -c "import tomllib; from pathlib import Path; data = tomllib.loads(Path('pyproject.toml').read_text()); print(data['project']['version'])")
- echo "Version: $VERSION"
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
-
- - name: Push changes and tags
- run: |
- git push origin main --follow-tags
-
- publish:
- needs: bump-version
- if: ${{ inputs.publish }}
- uses: ./.github/workflows/pypi-publish.yml
- with:
- version: ${{ needs.bump-version.outputs.version }}
- secrets: inherit
diff --git a/libs/cua-bench/.github/workflows/pypi-publish.yml b/libs/cua-bench/.github/workflows/pypi-publish.yml
deleted file mode 100644
index 8134018042..0000000000
--- a/libs/cua-bench/.github/workflows/pypi-publish.yml
+++ /dev/null
@@ -1,110 +0,0 @@
-name: Publish to PyPI
-
-on:
- push:
- tags:
- - "v*"
- workflow_dispatch:
- inputs:
- version:
- description: "Version to publish (without v prefix)"
- required: true
- default: "0.1.0"
- workflow_call:
- inputs:
- version:
- description: "Version to publish"
- required: true
- type: string
- secrets:
- PYPI_TOKEN:
- required: true
-
-permissions:
- contents: write
-
-jobs:
- build-and-publish:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- ref: main
- fetch-depth: 0
-
- - name: Ensure latest main branch
- run: |
- git fetch origin main
- git reset --hard origin/main
- echo "Current HEAD commit:"
- git log -1 --oneline
-
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: "3.11"
-
- - name: Install uv
- uses: astral-sh/setup-uv@v4
- with:
- version: "latest"
-
- - name: Determine version
- id: get-version
- run: |
- if [ -n "${{ inputs.version }}" ]; then
- VERSION=${{ inputs.version }}
- elif [[ "${{ github.ref }}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
- VERSION=${BASH_REMATCH[1]}
- else
- echo "ERROR: Could not determine version"
- exit 1
- fi
- echo "VERSION=$VERSION" >> $GITHUB_ENV
- echo "version=$VERSION" >> $GITHUB_OUTPUT
-
- - name: Verify version in pyproject.toml
- run: |
- PYPROJECT_VERSION=$(grep -oP '(?<=^version = ")[^"]+' pyproject.toml)
- if [ "$PYPROJECT_VERSION" != "$VERSION" ]; then
- echo "ERROR: Version mismatch - tag=$VERSION, pyproject.toml=$PYPROJECT_VERSION"
- exit 1
- fi
- echo "Version verified: $VERSION"
-
- - name: Build package
- run: |
- uv build
- echo "Built packages:"
- ls -la dist/
-
- - name: Publish to PyPI
- env:
- TWINE_USERNAME: __token__
- TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- run: |
- pip install twine
- twine upload dist/*
-
- - name: Create GitHub Release
- if: startsWith(github.ref, 'refs/tags/')
- uses: softprops/action-gh-release@v2
- with:
- name: "cua-bench v${{ env.VERSION }}"
- body: |
- # cua-bench v${{ env.VERSION }}
-
- ## Installation
-
- ```bash
- pip install cua-bench==${{ env.VERSION }}
- ```
-
- ## What's New
-
- See [CHANGELOG](https://github.com/trycua/cua-bench/blob/main/CHANGELOG.md) for details.
- files: dist/*
- draft: false
- prerelease: false
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}