Skip to content

Commit 162aa9b

Browse files
committed
fix: 每个RID用独立channel,修复重命名逻辑并增加调试输出
1 parent e626827 commit 162aa9b

1 file changed

Lines changed: 19 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,21 @@ jobs:
118118
- name: Download previous release for delta
119119
shell: bash
120120
run: |
121-
vpk download github --repoUrl https://github.com/mcobs/ObsMCLauncher --token ${{ secrets.RELEASE_TOKEN }} -o ./vpk-prev || echo "No previous release found, skipping delta"
121+
rid="${{ matrix.rid }}"
122+
vpk download github --repoUrl https://github.com/mcobs/ObsMCLauncher --token ${{ secrets.RELEASE_TOKEN }} -c "$rid" -o ./vpk-prev || echo "No previous release found, skipping delta"
122123
123124
- name: Pack with Velopack
124125
shell: bash
125126
run: |
126127
rid="${{ matrix.rid }}"
127128
if [[ "$rid" == win-* ]]; then
128-
channel="win"
129129
main_exe="ObsMCLauncher.Desktop.exe"
130-
elif [[ "$rid" == linux-* ]]; then
131-
channel="linux"
132-
main_exe="ObsMCLauncher.Desktop"
133-
elif [[ "$rid" == osx-* ]]; then
134-
channel="osx"
130+
else
135131
main_exe="ObsMCLauncher.Desktop"
136132
fi
137133
138-
# 构建vpk pack命令,-r需要完整RID格式
139-
pack_args=(-u ObsMCLauncher -v "${{ steps.version.outputs.version_number }}" -p "./publish/${{ matrix.rid }}" -e "$main_exe" -o ./vpk-output --delta BestSpeed -c "$channel" -r "$rid")
134+
# 每个RID用独立channel,避免不同架构的产物互相覆盖
135+
pack_args=(-u ObsMCLauncher -v "${{ steps.version.outputs.version_number }}" -p "./publish/${{ matrix.rid }}" -e "$main_exe" -o ./vpk-output --delta BestSpeed -c "$rid" -r "$rid")
140136
141137
# Windows才需要--noInst,Linux/macOS不生成安装程序
142138
if [[ "$rid" == win-* ]]; then
@@ -145,22 +141,28 @@ jobs:
145141
146142
vpk pack "${pack_args[@]}"
147143
148-
- name: Rename portable output
144+
- name: List vpk output and rename
149145
shell: bash
150146
run: |
151147
version="${{ steps.version.outputs.version }}"
152148
rid="${{ matrix.rid }}"
149+
echo "=== vpk-output 目录内容 ==="
150+
ls -la ./vpk-output/ || echo "目录不存在"
151+
152+
# 重命名便携包
153153
if [[ "$rid" == linux-* ]]; then
154-
if [ -f "./vpk-output/ObsMCLauncher.AppImage" ]; then
155-
mv ./vpk-output/ObsMCLauncher.AppImage "./vpk-output/ObsMCLauncher-${version}-${rid}.AppImage"
156-
fi
154+
for f in ./vpk-output/ObsMCLauncher*.AppImage; do
155+
[ -f "$f" ] && mv "$f" "./vpk-output/ObsMCLauncher-${version}-${rid}.AppImage"
156+
done
157157
else
158-
# Windows和macOS都产出Portable.zip
159-
if [ -f "./vpk-output/ObsMCLauncher-Portable.zip" ]; then
160-
mv ./vpk-output/ObsMCLauncher-Portable.zip "./vpk-output/ObsMCLauncher-${version}-${rid}.zip"
161-
fi
158+
for f in ./vpk-output/ObsMCLauncher*Portable*.zip; do
159+
[ -f "$f" ] && mv "$f" "./vpk-output/ObsMCLauncher-${version}-${rid}.zip"
160+
done
162161
fi
163162
163+
echo "=== 重命名后 ==="
164+
ls -la ./vpk-output/
165+
164166
- name: Upload artifact
165167
uses: actions/upload-artifact@v4
166168
with:

0 commit comments

Comments
 (0)