Skip to content

Commit 3b007a7

Browse files
committed
dist/ 目录下有多个同名的文件(global-proxy.js 和 auto-routing.js 分别在不同的子目录中),这导致了上传冲突。
添加了 Rename dist files with prefixes 步骤 该步骤会将 dist/ 目录下的所有 .js 文件复制到一个新的 dist-renamed/ 目录 文件名会根据其路径添加前缀,例如: dist/cfw/global-proxy.js → cfw-global-proxy.js dist/cvr/auto-routing.js → cvr-auto-routing.js dist/clash-party/global-proxy.js → clash-party-global-proxy.js 这样每个文件都有唯一的名称,不会再发生上传冲突。 预期上传的文件名: cfw-global-proxy.js cvr-global-proxy.js cvr-auto-routing.js clash-party-global-proxy.js clash-party-auto-routing.js
1 parent 2ba5c11 commit 3b007a7

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/release-build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,20 @@ jobs:
3030
- name: Run all tests
3131
run: npm run test:all
3232

33+
- name: Rename dist files with prefixes
34+
run: |
35+
mkdir -p dist-renamed
36+
for file in $(find dist -name "*.js"); do
37+
# 获取相对路径,例如 cfw/global-proxy.js
38+
relative_path=${file#dist/}
39+
# 将 / 替换为 - 作为前缀,例如 cfw-global-proxy.js
40+
new_name=$(echo "$relative_path" | sed 's/\//-/g')
41+
cp "$file" "dist-renamed/$new_name"
42+
done
43+
3344
- name: Upload release assets
3445
uses: softprops/action-gh-release@v2
3546
with:
36-
files: dist/**/*.js
47+
files: dist-renamed/*.js
3748
env:
3849
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)