File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ if [ $# -ne 1 ]; then
5+ echo " Usage: $0 <version> (e.g. 0.1.0 or v0.1.0)"
6+ exit 1
7+ fi
8+
9+ # Strip everything except digits and dots, so inputs like 'v0.1.0'
10+ # or 'release-1.2' become '0.1.0' and '1.2' respectively.
11+ RAW_VERSION=" $1 "
12+ VERSION=" $( printf ' %s' " $RAW_VERSION " | tr -cd ' 0-9.' ) "
13+
14+ if [ -z " $VERSION " ]; then
15+ echo " Error: could not extract numeric version from '$RAW_VERSION '"
16+ exit 1
17+ fi
18+
19+ # 1) Make sure main is up to date
20+ git checkout main
21+ git pull
22+
23+ # 2) Create an annotated tag
24+ git tag -a " v$VERSION " -m " cbm-basic v$VERSION "
25+
26+ # 3) Push main and the tag to GitHub
27+ git push
28+ git push origin " v$VERSION "
29+
30+ # 4) GitHub Actions workflow will build artifacts and create a Release for v$VERSION
You can’t perform that action at this time.
0 commit comments