Skip to content

Commit 1c76881

Browse files
Suyunmengxrgzs
authored andcommitted
fixed(ci):fixed release ci (OpenListTeam#65)
* fixed(ci):fixed release ci * fixed(ci):fixed release ci
1 parent 7294d75 commit 1c76881

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/build_release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ jobs:
158158
159159
- name: Build Lite Release
160160
run: |
161+
rm -rf .git
161162
rm -rf .git
162163
cp -r ../.git .git
163164
chmod +x build.sh
@@ -206,4 +207,4 @@ jobs:
206207
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
207208

208209
permissions:
209-
contents: write
210+
contents: write

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 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."
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."
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 origin/main 2>/dev/null || echo "v0.0.0")
118+
git_version=$(git describe --abbrev=0 --tags 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)