@@ -81,3 +81,74 @@ export PS1="(${VM_NAME}) ${__OLD_PS1}"
8181
8282"""
8383
84+
85+ ["beeai-platform:release" ]
86+ description = " Bump version across all platform components and sync dependencies"
87+ usage = '''
88+ arg "version" "must follow pattern 1.2.3[-rc4]"
89+ '''
90+
91+ run = """
92+ #!/bin/bash
93+ set -e
94+
95+ # Get the new version from argument
96+ NEW_VERSION="{{arg(name='version')}}"
97+
98+ # Validate version format
99+ if ! [[ "$NEW_VERSION" =~ ^[0-9]+\\ .[0-9]+\\ .[0-9]+(-rc[0-9]+)?$ ]]; then
100+ echo "ERROR: Invalid version format. Use #.#.# or #.#.#-rc#"
101+ echo "Examples: 1.2.3, 0.2.15-rc6"
102+ exit 1
103+ fi
104+
105+ echo "Bumping version to $NEW_VERSION"
106+
107+ # Python projects - using toml set to preserve version format
108+ echo "Updating Python projects..."
109+ cd apps/beeai-cli && toml set 'project.version' "$NEW_VERSION" --toml-path pyproject.toml && uv lock
110+ cd ../beeai-server && toml set 'project.version' "$NEW_VERSION" --toml-path pyproject.toml && uv lock
111+ cd ../../
112+
113+ # Node.js projects - using npm to update package.json files
114+ echo "Updating Node.js projects..."
115+ cd apps/beeai-ui && npm version "$NEW_VERSION" --no-git-tag-version
116+ cd ../beeai-web && npm version "$NEW_VERSION" --no-git-tag-version
117+ cd ../../
118+
119+ # Update Helm Chart using yq (multi-platform)
120+ echo "Updating Helm chart..."
121+ yq -i ".version = \\ "$NEW_VERSION\\ "" helm/Chart.yaml
122+ yq -i ".appVersion = \\ "$NEW_VERSION\\ "" helm/Chart.yaml
123+
124+ # Sync dependencies using mise tasks
125+ echo "Syncing dependencies..."
126+ {{ mise_bin }} run beeai-cli:setup
127+ {{ mise_bin }} run beeai-server:setup
128+ {{ mise_bin }} run common:setup:pnpm
129+
130+ echo "Version bump to $NEW_VERSION completed successfully!"
131+ echo "Dependencies synchronized for all projects."
132+
133+ # Add files to git staging
134+ git add helm/Chart.yaml apps/beeai-{cli,server}/{uv.lock,pyproject.toml} apps/beeai-{ui,web}/package.json
135+
136+ echo ""
137+ echo "Changes made:"
138+ git diff --cached
139+
140+ # Ask user if they want to commit and push
141+ read -p "Create commit and push to main? [Y/n] " confirm
142+ if [[ "${confirm:-y}" =~ ^[Yy]$ ]]; then
143+ git commit -m "release: v$NEW_VERSION"
144+ git tag "v$NEW_VERSION"
145+ git push --atomic origin main "v$NEW_VERSION"
146+ echo "Successfully committed and pushed version v$NEW_VERSION"
147+ else
148+ echo "Changes staged but not committed. You can commit manually with:"
149+ echo " git commit -m 'release: v$NEW_VERSION'"
150+ echo " git tag 'v$NEW_VERSION'"
151+ echo " git push --atomic origin main 'v$NEW_VERSION'"
152+ fi
153+
154+ """
0 commit comments