Skip to content

Commit f7d509a

Browse files
committed
fixed(ci):fixed release build bugs
1 parent 72b190b commit f7d509a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ check_git_version_and_commit() {
9494

9595
# Enforce git tag for release builds
9696
enforce_git_tag() {
97-
if ! git_version=$(git describe --abbrev=0 --tags 2>/dev/null); then
98-
log_error "No git tags found. Release build requires a git tag."
99-
log_warning "Please create a tag first, or use --dev for development builds."
97+
if ! git_version=$(git describe --abbrev=0 --tags origin/main 2>/dev/null); then
98+
log_error "No git tags found on main branch. Release build requires a git tag."
99+
log_warning "Please create a tag on main branch first, or use --dev for development builds."
100100
exit 1
101101
fi
102102
validate_git_tag
@@ -115,7 +115,7 @@ validate_git_tag() {
115115
# Fallback to default git tag for development builds
116116
fallback_git_tag() {
117117
git tag -d rolling >/dev/null 2>&1 || true
118-
git_version=$(git describe --abbrev=0 --tags 2>/dev/null || echo "v0.0.0")
118+
git_version=$(git describe --abbrev=0 --tags origin/main 2>/dev/null || echo "v0.0.0")
119119
git_version_clean=${git_version#v}
120120
git_version_clean=${git_version_clean%%-*}
121121
}

0 commit comments

Comments
 (0)