Skip to content

Commit 7882af7

Browse files
authored
chore: stable branch releasing (#1665)
* chore: release process improvements Signed-off-by: Tomas Weiss <[email protected]> * chore: remove unneeeded script Signed-off-by: Tomas Weiss <[email protected]> * chore: change deploy script Signed-off-by: Tomas Weiss <[email protected]> * docs: docs for release process Signed-off-by: Tomas Weiss <[email protected]> * chore: tag and push for pipeline trigger Signed-off-by: Tomas Weiss <[email protected]> * chore: more sanity check Signed-off-by: Tomas Weiss <[email protected]> * chore: upgrade pipeline Signed-off-by: Tomas Weiss <[email protected]> * chore: code review fixes Signed-off-by: Tomas Weiss <[email protected]> * chore: code review fixes Signed-off-by: Tomas Weiss <[email protected]> * chore: update bump script Signed-off-by: Tomas Weiss <[email protected]> * chore: improving pipeline Signed-off-by: Tomas Weiss <[email protected]> * chore: improving DRY Signed-off-by: Tomas Weiss <[email protected]> * chore: improve pipeline Signed-off-by: Tomas Weiss <[email protected]> * chore: docs for release process Signed-off-by: Tomas Weiss <[email protected]> * chore: fix mise run in favour of {{ mise_bin }} Signed-off-by: Tomas Weiss <[email protected]> --------- Signed-off-by: Tomas Weiss <[email protected]> Signed-off-by: Tomáš Weiss <[email protected]>
1 parent b90c666 commit 7882af7

File tree

5 files changed

+175
-35
lines changed

5 files changed

+175
-35
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,38 @@ mise agentstack-server:run
316316

317317
## Releasing
318318

319-
> ⚠️ **IMPORTANT**
320-
> Always create pre-release before the actual public release and check that the upgrade and installation work.
319+
Agent Stack is using `main` branch for next version development and `release` branch for stable releases.
321320

322-
Use the release script:
321+
The release process consists of three steps:
322+
323+
### Step 1: Cut the release
324+
325+
Run the `release:new` task from the `main` branch:
326+
327+
```shell
328+
mise run release:new
329+
```
330+
331+
This would
332+
333+
1. reset the `release` branch to latest `main`
334+
2. bumps the release to `rc1`
335+
3. bumps the next version in `main`.
336+
337+
### Step 2: QA & Polish the release on release branch
338+
339+
You can then iteratively polish the release in `main` branch and cherry-pick the commits to `release`. You can then do `mise run release:bump --version=X.Y.Z-rcW` to push new RC for testing.
340+
341+
### Step 3: Deploy
342+
343+
Once you've verified the RC version works, deploy the final release from the `release` branch:
323344

324345
```shell
325-
mise run release
346+
git checkout release
347+
mise run release:publish
326348
```
327349

350+
This task will simply create a final tag for `release` version and push, which triggers GH action to deploy to pypi and npm.
328351

329352
## Documentation
330353

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Built on the [Agent2Agent (A2A) Protocol](https://a2a-protocol.org/) and hosted
5252
### Installation
5353

5454
```sh
55-
sh -c "$(curl -LsSf https://raw.githubusercontent.com/i-am-bee/agentstack/HEAD/install.sh)"
55+
sh -c "$(curl -LsSf https://raw.githubusercontent.com/i-am-bee/agentstack/release/install.sh)"
5656
```
5757

5858
> [!TIP]

apps/beeai-web/src/modules/blog/posts/introducing-agent-stack.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ If you're building agents and wrestling with deployment, Agent Stack might be wo
8888
Get up and running in one line:
8989

9090
```
91-
sh -c "$(curl -LsSf https://raw.githubusercontent.com/i-am-bee/agentstack/HEAD/install.sh)"
91+
sh -c "$(curl -LsSf https://raw.githubusercontent.com/i-am-bee/agentstack/release/install.sh)"
9292
```
9393

9494
Then check out our [Quickstart Guide](https://agentstack.beeai.dev/introduction/quickstart).
@@ -111,7 +111,7 @@ beeai self uninstall
111111
2. Install Agent Stack
112112

113113
```
114-
sh -c "$(curl -LsSf https://raw.githubusercontent.com/i-am-bee/agentstack/HEAD/install.sh)"
114+
sh -c "$(curl -LsSf https://raw.githubusercontent.com/i-am-bee/agentstack/release/install.sh)"
115115
```
116116

117117
3. Use the new CLI

docs/introduction/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ description: "Get a running instance in minutes and explore pre-built agents"
1919
Open the terminal and run this command to install Agent Stack:
2020

2121
```bash
22-
sh -c "$(curl -LsSf https://raw.githubusercontent.com/i-am-bee/agentstack/HEAD/install.sh)"
22+
sh -c "$(curl -LsSf https://raw.githubusercontent.com/i-am-bee/agentstack/release/install.sh)"
2323
```
2424

2525
This interactive script installs Agent Stack CLI, downloads and starts the platform, prompts you to configure your LLM API key, then launches the web interface.

tasks.toml

Lines changed: 144 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -182,47 +182,103 @@ export PS1="(${VM_NAME}) ${__OLD_PS1}"
182182
183183
"""
184184

185-
["release"]
185+
["release:new"]
186186
dir = "{{config_root}}"
187187
run = '''
188188
#!/bin/bash
189189
set -eu -o pipefail
190190
191-
# Ensure on main branch
191+
if [[ -n "$(git status --porcelain)" ]]; then
192+
echo "ERROR: Working directory not clean"
193+
exit 1
194+
fi
195+
196+
197+
192198
current_branch=$(git rev-parse --abbrev-ref HEAD)
193199
if [[ "$current_branch" != "main" ]]; then
194200
echo "ERROR: You must be on the 'main' branch (current: $current_branch)"
195201
exit 1
196202
fi
197203
198-
# Ensure working directory is clean
199-
if [[ -n "$(git status --porcelain)" ]]; then
200-
echo "ERROR: Working directory not clean"
201-
git status
204+
current_version=$(yq -r '.version' helm/Chart.yaml)
205+
rc_version="${current_version}-rc1"
206+
207+
if [[ "$current_version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
208+
major="${BASH_REMATCH[1]}"
209+
minor="${BASH_REMATCH[2]}"
210+
patch="${BASH_REMATCH[3]}"
211+
next_version="${major}.${minor}.$((patch + 1))"
212+
else
213+
echo "ERROR: Invalid version format: $current_version. Expected format: X.Y.Z"
202214
exit 1
203215
fi
204216
205-
current_version=$(yq -r '.version' helm/Chart.yaml)
217+
# Show what will happen and ask for confirmation
218+
echo " Current version (main): $current_version"
219+
echo ""
220+
echo " Actions:"
221+
echo " 1. Create RC in release branch: $rc_version"
222+
echo " 2. Bump version in main branch: $next_version"
223+
echo ""
224+
225+
if ! gum confirm "Proceed with the release?"; then
226+
echo "Release cancelled."
227+
exit 0
228+
fi
206229
207-
# Compute suggested next rc version
208-
if [[ "$current_version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(-rc([0-9]+))?$ ]]; then
209-
if [[ -n "${BASH_REMATCH[5]}" ]]; then
210-
suggested_new_version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}-rc$((${BASH_REMATCH[5]} + 1))"
211-
else
212-
suggested_new_version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.$((${BASH_REMATCH[3]} + 1))-rc1"
213-
fi
230+
git checkout release
231+
git reset --hard origin/main
232+
233+
{{ mise_bin }} release:bump --version="$rc_version"
234+
235+
git checkout main
236+
git pull origin main
237+
238+
# Bump version on main
239+
{{ mise_bin }} release:bump --version="$next_version"
240+
'''
241+
242+
["release:_update-install-sh"]
243+
hide = true
244+
dir = "{{config_root}}"
245+
run = '''
246+
#!/bin/bash
247+
set -eu -o pipefail
248+
249+
version='{{option(name="version", required=true)}}'
250+
251+
# Update install.sh based on version type
252+
if [[ "$version" == *"-rc"* ]]; then
253+
# RC version - update LATEST_AGENTSTACK_VERSION only
254+
perl -pi -e "s/^(LATEST_AGENTSTACK_VERSION=).*/\${1}$version/" install.sh
214255
else
215-
echo "ERROR: Invalid version format of current version. Use #.#.#[-rc#]"
216-
exit 1
256+
# Stable version - update BOTH constants (stable becomes new latest)
257+
perl -pi -e "s/^(LATEST_STABLE_AGENTSTACK_VERSION=).*/\${1}$version/" install.sh
258+
perl -pi -e "s/^(LATEST_AGENTSTACK_VERSION=).*/\${1}$version/" install.sh
217259
fi
218260
219-
# Prompt for new version
220-
new_version=$(gum input --prompt.foreground="8" --prompt "Bump from ${current_version} -> " --value "$suggested_new_version")
221-
if [[ ! "$new_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then
222-
echo "ERROR: Invalid version format of new version. Use #.#.#[-rc#]"
261+
echo "Updated install.sh version constants for: $version"
262+
'''
263+
264+
["release:bump"]
265+
dir = "{{config_root}}"
266+
run = '''
267+
#!/bin/bash
268+
set -eu -o pipefail
269+
270+
# Get version parameter
271+
new_version='{{option(name="version", required=true)}}'
272+
273+
# Validate version format (X.Y.Z or X.Y.Z-rcW)
274+
if ! [[ "$new_version" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(-rc[0-9]+)?$ ]]; then
275+
echo "ERROR: Invalid version format: $new_version"
276+
echo "Expected format: X.Y.Z or X.Y.Z-rcW (e.g., 1.2.3 or 1.2.3-rc1)"
223277
exit 1
224278
fi
225279
280+
echo "Updating version to $new_version..."
281+
226282
# Update all version fields
227283
yq -i ".version = \"$new_version\"" helm/Chart.yaml
228284
yq -i ".appVersion = \"$new_version\"" helm/Chart.yaml
@@ -234,21 +290,82 @@ yq -i ".version = \"$new_version\"" apps/agentstack-sdk-ts/package.json
234290
yq -i ".version = \"$new_version\"" apps/agentstack-ui/package.json
235291
yq -i ".version = \"$new_version\"" apps/beeai-web/package.json
236292
yq -i ".providers[].location |= sub(\":(.*)\$\"; \":\" + \"$new_version\")" agent-registry.yaml
237-
perl -pi -e "s/^(LATEST_AGENTSTACK_VERSION=).*/\${1}$new_version/" install.sh
238-
if [[ "$new_version" != *"-rc"* ]]; then perl -pi -e "s/^(LATEST_STABLE_AGENTSTACK_VERSION=).*/\${1}$new_version/" install.sh; fi
293+
294+
{{ mise_bin }} release:_update-install-sh --version="$new_version"
295+
296+
git add .
297+
git commit -m "bump: v$new_version"
298+
299+
current_branch=$(git rev-parse --abbrev-ref HEAD)
300+
if [[ "$current_branch" == "release" ]]; then
301+
echo "On release branch, tagging and pushing tag..."
302+
git tag "v$new_version"
303+
git push origin tag "v$new_version"
304+
echo "✅ Version updated to $new_version, tagged and pushed"
305+
elif [[ "$current_branch" == "main" ]]; then
306+
echo "On main branch, pushing to origin..."
307+
git push origin main
308+
echo "✅ Version updated to $new_version, committed and pushed to main"
309+
else
310+
echo "ERROR: Cannot push from branch '$current_branch'. Only 'release' and 'main' branches are supported."
311+
exit 1
312+
fi
313+
'''
314+
315+
["release:publish"]
316+
dir = "{{config_root}}"
317+
run = '''
318+
#!/bin/bash
319+
set -eu -o pipefail
320+
321+
# Ensure on release branch
322+
current_branch=$(git rev-parse --abbrev-ref HEAD)
323+
if [[ "$current_branch" != "release" ]]; then
324+
echo "ERROR: You must be on the 'release' branch (current: $current_branch)"
325+
exit 1
326+
fi
327+
328+
# Ensure working directory is clean
329+
if [[ -n "$(git status --porcelain)" ]]; then
330+
echo "ERROR: Working directory not clean"
331+
git status
332+
exit 1
333+
fi
334+
335+
current_version=$(yq -r '.version' helm/Chart.yaml)
336+
publish_version="${current_version%-rc*}"
239337
240338
# Confirm commit and push
241-
if gum confirm "Release version $new_version now?"; then
339+
if gum confirm "Publish version $publish_version now?"; then
242340
(
243341
set -eux -o pipefail
342+
{{ mise_bin }} release:bump --version="$publish_version"
343+
244344
git add .
245-
git commit -m "release: v$new_version"
246-
git tag "v$new_version"
247-
git push --atomic origin main "v$new_version"
345+
git commit -m "deploy: v$publish_version"
346+
git tag "v$publish_version"
347+
git push origin tag "v$publish_version"
348+
git push origin release
349+
)
350+
351+
# Backport install.sh version updates to main branch
352+
echo "Backporting install.sh version updates to main branch..."
353+
(
354+
set -eux -o pipefail
355+
git checkout main
356+
git pull origin main
357+
358+
{{ mise_bin }} release:_update-install-sh --version="$publish_version"
359+
360+
git add install.sh
361+
git commit -m "chore: update install.sh version to v$publish_version"
362+
git push origin main
363+
git checkout release
248364
)
365+
249366
if command -v gh >/dev/null; then
250367
gum spin --title="Waiting for GitHub Action to start..." sleep 10
251-
gh run watch $(gh run list --workflow=Release --branch=v$new_version --limit=1 --json databaseId,status -q '.[0].databaseId') || true
368+
gh run watch $(gh run list --workflow=Release --branch=v$publish_version --limit=1 --json databaseId,status -q '.[0].databaseId') || true
252369
fi
253370
echo "GitHub action started. Check the progress and result on: https://github.com/i-am-bee/agentstack/actions/workflows/release.yml"
254371
fi

0 commit comments

Comments
 (0)