1#!/usr/bin/env bash
2
3set -eu
4
5usage() {
6 echo "Usage: $0 [target]"
7 echo ""
8 echo "Triggers the bump_zed_version workflow to perform a minor release version bump "
9 echo "and update the stable and preview versions."
10 echo ""
11 echo "Arguments:"
12 echo " target Which channels to bump: all (default), main, preview, or stable"
13 exit 1
14}
15
16target="${1:-all}"
17
18if [[ "$target" != "all" && "$target" != "main" && "$target" != "preview" && "$target" != "stable" ]]; then
19 echo "error: invalid target '$target'" >&2
20 echo "Valid targets: all, main, preview, stable" >&2
21 exit 1
22fi
23
24day_of_week=$(date +%u)
25if [[ $day_of_week -ne 3 ]]; then
26 day_name=$(date +%A)
27 echo "Warning: Today is $day_name. Release version bumps are typically only done on Zednesdays."
28 read -r -p "Continue anyway? (y/N) " confirm
29 if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
30 echo "Aborted."
31 exit 0
32 fi
33fi
34
35which gh > /dev/null 2>&1 || {
36 echo "error: GitHub CLI (gh) is required but not installed." >&2
37 echo "Install it with: brew install gh" >&2
38 exit 1
39}
40
41echo "Triggering bump_zed_version workflow:"
42echo " target: $target"
43echo ""
44
45gh workflow run bump_zed_version.yml \
46 -f target="$target"
47
48echo ""
49echo "Workflow triggered. Monitor progress at:"
50echo " https://github.com/zed-industries/zed/actions/workflows/bump_zed_version.yml"