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.

cd-cua-spaces: publish Release Please's notes, not the generic line (#5991)

cua-agents[bot]decd5c66f286
diff --git a/.github/scripts/spaces_release_notes.sh b/.github/scripts/spaces_release_notes.sh
new file mode 100755
index 0000000000..561c8b05ec
--- /dev/null
+++ b/.github/scripts/spaces_release_notes.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: FSL-1.1-MIT
+# Copyright (c) 2026 Cua AI, Inc.
+# Prints the real notes for a Cua Spaces version on stdout.
+#
+# spaces_release_notes.sh <version> (GH_TOKEN and GITHUB_REPOSITORY set)
+#
+# Release Please writes the notes into a draft titled "cua-spaces: v<version>",
+# which GitHub lists as "untagged-..." and which `gh release view <tag>` does not
+# find. Use that body first, then this version's CHANGELOG.md section, then the
+# generic line.
+set -euo pipefail
+version="$1"
+repo="${GITHUB_REPOSITORY:-trycua/cua}"
+body="$(gh api --paginate "repos/$repo/releases?per_page=100" \
+ --jq ".[] | select(.draft and .name == \"cua-spaces: v$version\") | .body" 2>/dev/null | head -c 100000 || true)"
+if [ -n "${body//[[:space:]]/}" ]; then
+ printf '%s\n' "$body"
+ exit 0
+fi
+here="$(cd "$(dirname "$0")/../.." && pwd)"
+changelog="$here/apps/cua-spaces-macos/CHANGELOG.md"
+if [ -f "$changelog" ]; then
+ python3 "$here/apps/cua-spaces-macos/scripts/changelog-notes.py" "$version" "$changelog"
+else
+ echo "Cua Spaces $version."
+fi
diff --git a/.github/workflows/cd-cua-spaces.yml b/.github/workflows/cd-cua-spaces.yml
index 19d6b69b86..bc591e2db8 100644
--- a/.github/workflows/cd-cua-spaces.yml
+++ b/.github/workflows/cd-cua-spaces.yml
@@ -421,8 +421,11 @@ jobs:
set -euo pipefail
tag="cua-spaces-v${VERSION}"
if ! gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
+ # Release Please's draft is untagged, so it is not found above: carry
+ # its notes over instead of the generic line.
+ .github/scripts/spaces_release_notes.sh "$VERSION" > "$RUNNER_TEMP/release-notes.md"
flags=(--draft --verify-tag --title "Cua Spaces v${VERSION}"
- --notes "Automated Cua Spaces release.")
+ --notes-file "$RUNNER_TEMP/release-notes.md")
[ "$PRERELEASE" = true ] && flags+=(--prerelease)
gh release create "$tag" --repo "$GITHUB_REPOSITORY" "${flags[@]}"
fi
@@ -1806,8 +1809,9 @@ jobs:
tag="cua-spaces-v${VERSION}"
# build-macos normally made the draft; a hand-pushed tag may race it.
if ! gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
+ .github/scripts/spaces_release_notes.sh "$VERSION" > "$RUNNER_TEMP/release-notes.md"
gh release create "$tag" --repo "$GITHUB_REPOSITORY" --draft --prerelease --verify-tag \
- --title "Cua Spaces v${VERSION}" --notes "Automated Cua Spaces release." \
+ --title "Cua Spaces v${VERSION}" --notes-file "$RUNNER_TEMP/release-notes.md" \
|| gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null
fi
mkdir -p feed signing
@@ -2208,6 +2212,15 @@ jobs:
} > notes.md
flags+=(--title "Cua Spaces v$VERSION ($label)" --notes-file notes.md)
fi
+ # A release made with the generic line (a hand-pushed tag, a race)
+ # gets the real notes now. Staging notes above stay as they are.
+ if ! printf '%s ' "${flags[@]}" | grep -q -- '--notes-file'; then
+ current="$(gh release view "$TAG" --repo "$GITHUB_REPOSITORY" --json body --jq .body)"
+ if [ -z "${current//[[:space:]]/}" ] || [ "$current" = "Automated Cua Spaces release." ]; then
+ .github/scripts/spaces_release_notes.sh "$VERSION" > real-notes.md
+ flags+=(--notes-file real-notes.md)
+ fi
+ fi
gh release edit "$TAG" "${flags[@]}" --repo "$GITHUB_REPOSITORY"
# Say which platforms a patch release contains (CUA-2068). A full release
# keeps its notes as they are.