mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-13 19:20:04 +00:00
🐛 fix(ci): add version prefix to latest*.yml URLs in S3 upload (#12770)
The latest*.yml files uploaded to S3 channel root lacked the $VERSION/ prefix in their URLs, causing electron-updater to request files at the wrong path (e.g., /canary/LobeHub-Canary-xxx.zip instead of /canary/2.1.38-canary.1/LobeHub-Canary-xxx.zip), resulting in 404. Now sed -i modifies latest*.yml in-place before uploading, and channel-specific yml files are copied from the already-modified ones.
This commit is contained in:
@@ -83,21 +83,32 @@ runs:
|
||||
fi
|
||||
done
|
||||
|
||||
# 2. 创建 {channel}*.yml (从 latest*.yml 复制,URL 加版本目录前缀)
|
||||
# 2. 为所有 latest*.yml 的 URL 加版本目录前缀
|
||||
# electron-builder 始终生成 latest*.yml,不区分 channel
|
||||
# 安装包在 s3://$BUCKET/$CHANNEL/$VERSION/ 下,URL 需加 $VERSION/ 前缀
|
||||
echo ""
|
||||
echo "📋 Adding version prefix to latest*.yml URLs..."
|
||||
for yml in release/latest*.yml; do
|
||||
if [ -f "$yml" ]; then
|
||||
# url: xxx.dmg -> url: {VERSION}/xxx.dmg
|
||||
sed -i "s|url: |url: $VERSION/|g" "$yml"
|
||||
echo " 📄 Updated $(basename $yml) with URL prefix: $VERSION/"
|
||||
fi
|
||||
done
|
||||
|
||||
# 3. 创建 {channel}*.yml (从已修改的 latest*.yml 复制)
|
||||
# electron-updater 在对应 channel 时会找 {channel}-mac.yml
|
||||
echo ""
|
||||
echo "📋 Creating ${CHANNEL}*.yml files from latest*.yml..."
|
||||
for yml in release/latest*.yml; do
|
||||
if [ -f "$yml" ]; then
|
||||
channel_name=$(basename "$yml" | sed "s/latest/$CHANNEL/")
|
||||
# url: xxx.dmg -> url: {VERSION}/xxx.dmg
|
||||
sed "s|url: |url: $VERSION/|g" "$yml" > "release/$channel_name"
|
||||
echo " 📄 Created $channel_name from $(basename $yml) with URL prefix: $VERSION/"
|
||||
cp "$yml" "release/$channel_name"
|
||||
echo " 📄 Created $channel_name from $(basename $yml)"
|
||||
fi
|
||||
done
|
||||
|
||||
# 3. 创建 renderer manifest (仅 stable 渠道有 renderer tar)
|
||||
# 4. 创建 renderer manifest (仅 stable 渠道有 renderer tar)
|
||||
RENDERER_TAR="release/lobehub-renderer.tar.gz"
|
||||
if [ -f "$RENDERER_TAR" ]; then
|
||||
echo ""
|
||||
@@ -118,7 +129,7 @@ runs:
|
||||
echo " 📄 Created ${CHANNEL}-renderer.yml"
|
||||
fi
|
||||
|
||||
# 4. 上传 manifest 到根目录和版本目录
|
||||
# 5. 上传 manifest 到根目录和版本目录
|
||||
# 根目录: electron-updater 需要,每次发版覆盖
|
||||
# 版本目录: 作为存档保留
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user