File tree Expand file tree Collapse file tree 2 files changed +81
-0
lines changed
Expand file tree Collapse file tree 2 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [ -z " $1 " ]; then
4+ echo " Usage: $0 <new-version>"
5+ exit 1
6+ fi
7+
8+ NEW_VERSION=$1
9+
10+ # Update version
11+ bash helpers/update-version.sh " $NEW_VERSION "
12+ if [ $? -ne 0 ]; then
13+ echo " Failed to update version. Aborting release."
14+ exit 1
15+ fi
16+
17+ # Commit the changes
18+ git add src/github-custom-global-navigation.user.js
19+ git commit -m " Release commit for $NEW_VERSION "
20+ if [ $? -ne 0 ]; then
21+ echo " Failed to commit changes. Aborting release."
22+ exit 1
23+ fi
24+
25+ # Create a tag
26+ git tag " $NEW_VERSION "
27+ if [ $? -ne 0 ]; then
28+ echo " Failed to create tag. Aborting release."
29+ exit 1
30+ fi
31+
32+ # Push the commit
33+ git push
34+ if [ $? -ne 0 ]; then
35+ echo " Failed to push commit. Aborting release."
36+ exit 1
37+ fi
38+
39+ # Push the tag
40+ git push origin " $NEW_VERSION "
41+ if [ $? -ne 0 ]; then
42+ echo " Failed to push tag. Aborting release."
43+ exit 1
44+ fi
45+
46+ echo " Release $NEW_VERSION completed successfully."
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ if [ -z " $1 " ]; then
4+ echo " Usage: $0 <new-version>"
5+ exit 1
6+ fi
7+
8+ NEW_VERSION=$1
9+ FILE=" src/github-custom-global-navigation.user.js"
10+
11+ if [ ! -f " $FILE " ]; then
12+ echo " File $FILE not found!"
13+ exit 1
14+ fi
15+
16+ # Update @version line with flexible spacing
17+ sed -i ' ' -E " s|@version[[:space:]]+[0-9]+\.[0-9]+\.[0-9]+|@version $NEW_VERSION |" " $FILE "
18+ if [ $? -ne 0 ]; then
19+ echo " Failed to update @version. Aborting."
20+ exit 1
21+ fi
22+
23+ # Update const VERSION declaration
24+ sed -i ' ' -E " s|const VERSION = '[0-9]+\.[0-9]+\.[0-9]+';|const VERSION = '$NEW_VERSION ';|" " $FILE "
25+ if [ $? -ne 0 ]; then
26+ echo " Failed to update VERSION. Aborting."
27+ exit 1
28+ fi
29+
30+ if [ $? -eq 0 ]; then
31+ echo " Version updated to $NEW_VERSION in $FILE "
32+ else
33+ echo " Failed to update version in $FILE "
34+ exit 1
35+ fi
You can’t perform that action at this time.
0 commit comments