Skip to content

Commit a8688ce

Browse files
committed
fix(ci): handle filenames with spaces in release upload
1 parent 7de2a54 commit a8688ce

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

.github/workflows/desktop-build.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
push:
55
branches: [ main, master, feat/desktop-branch ]
66
tags:
7-
- 'v*.*.*-*'
7+
- 'v*.*.*-*' # prerelease: v0.1.0-beta.1
8+
- 'v[0-9]*.[0-9]*.[0-9]*' # release: v0.1.0 (纯版本号)
89
paths:
910
- 'desktop/**'
1011
- '.github/workflows/desktop-build.yml'
@@ -130,12 +131,8 @@ jobs:
130131
--prerelease \
131132
--title "${GITHUB_REF_NAME}" \
132133
--notes "Prerelease ${GITHUB_REF_NAME}"
133-
files=$(find dist -type f)
134-
if [ -z "$files" ]; then
135-
echo "No artifacts found under dist/"
136-
exit 1
137-
fi
138-
gh release upload "${GITHUB_REF_NAME}" $files --clobber
134+
# 处理带空格的文件名
135+
find dist -type f -print0 | xargs -0 -I {} gh release upload "${GITHUB_REF_NAME}" "{}" --clobber
139136
140137
release:
141138
name: Publish release
@@ -164,9 +161,5 @@ jobs:
164161
gh release create "${GITHUB_REF_NAME}" \
165162
--title "${GITHUB_REF_NAME}" \
166163
--notes "Release ${GITHUB_REF_NAME}"
167-
files=$(find dist -type f)
168-
if [ -z "$files" ]; then
169-
echo "No artifacts found under dist/"
170-
exit 1
171-
fi
172-
gh release upload "${GITHUB_REF_NAME}" $files --clobber
164+
# 处理带空格的文件名
165+
find dist -type f -print0 | xargs -0 -I {} gh release upload "${GITHUB_REF_NAME}" "{}" --clobber

0 commit comments

Comments
 (0)