Skip to content

Commit 880f7cc

Browse files
committed
fix(release): 改用改写配置文件替代 -c.publish.0.url 覆盖更新源
electron-builder 会把 -c.publish.0.url 解析成对象 {publish:{0:{url}}} 而非数组元素,触发 ValidationError: configuration.publish should be one of these,导致 v0.28.8 构建失败。 改为在构建前用 sed 行锚定改写 electron-builder.yml 中 generic provider 的 url,并打印改写结果便于核对;未配置 DOWNLOAD_BASE_URL 时保持配置文件原值。
1 parent f01dc6b commit 880f7cc

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,16 @@ jobs:
7373
run: |
7474
cd client
7575
if [ -n "$DOWNLOAD_BASE_URL" ]; then
76-
echo "Update feed -> $DOWNLOAD_BASE_URL"
77-
npm run electron:build -- --publish never -c.publish.0.url="$DOWNLOAD_BASE_URL"
76+
# 不能用 -c.publish.0.url 覆盖:electron-builder 会将其解析成
77+
# 对象 {publish:{0:{url}}} 而非数组元素,触发 schema 校验失败。
78+
# 故直接改写配置文件中 generic provider 的 url(行锚定精确匹配)。
79+
sed -i "s|^ url: https://entropydecrease.com/downloads$| url: ${DOWNLOAD_BASE_URL%/}|" electron-builder.yml
80+
echo 'generic provider after rewrite:'
81+
grep -A1 'provider: generic' electron-builder.yml
7882
else
7983
echo "Update feed -> 默认(electron-builder.yml 中的自建服务器)"
80-
npm run electron:build -- --publish never
8184
fi
85+
npm run electron:build -- --publish never
8286
- uses: actions/upload-artifact@v4
8387
with:
8488
name: release-${{ matrix.os }}

0 commit comments

Comments
 (0)