Skip to content

Commit 01761f8

Browse files
committed
fix: 更新版本号至 1.2.2,并优化下载跳过逻辑
1 parent aac4964 commit 01761f8

3 files changed

Lines changed: 67 additions & 6 deletions

File tree

.github/workflows/main.yml

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,34 @@ jobs:
132132
src-tauri/binaries/openlist-x86_64-unknown-linux-gnu
133133
key: binaries-x86_64-unknown-linux-gnu-${{ env.RCLONE_VERSION }}-${{ env.OPENLIST_VERSION }}
134134

135+
- name: Resolve skip-downloads flag
136+
id: resolve-skip-downloads
137+
shell: bash
138+
run: |
139+
set -euo pipefail
140+
if [ "${{ steps.cache-binaries.outputs.cache-hit }}" != "true" ]; then
141+
echo "skip_downloads=false" >> "$GITHUB_OUTPUT"
142+
exit 0
143+
fi
144+
145+
has_rclone=false
146+
has_openlist=false
147+
148+
if [ -f "src-tauri/binaries/rclone" ] || [ -f "src-tauri/binaries/rclone-x86_64-unknown-linux-gnu" ]; then
149+
has_rclone=true
150+
fi
151+
152+
if [ -f "src-tauri/binaries/openlist" ] || [ -f "src-tauri/binaries/openlist-x86_64-unknown-linux-gnu" ]; then
153+
has_openlist=true
154+
fi
155+
156+
if [ "$has_rclone" = "true" ] && [ "$has_openlist" = "true" ]; then
157+
echo "skip_downloads=true" >> "$GITHUB_OUTPUT"
158+
else
159+
echo "skip_downloads=false" >> "$GITHUB_OUTPUT"
160+
echo "Cache hit but required binaries are missing; downloads remain enabled."
161+
fi
162+
135163
- run: pnpm install --frozen-lockfile
136164

137165
# 如果缓存命中,跳过下载
@@ -143,7 +171,7 @@ jobs:
143171
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
144172
# Tauri 签名私钥密码(如果密钥已加密)
145173
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
146-
NETMOUNT_SKIP_BIN_DOWNLOADS: ${{ steps.cache-binaries.outputs.cache-hit }}
174+
NETMOUNT_SKIP_BIN_DOWNLOADS: ${{ steps.resolve-skip-downloads.outputs.skip_downloads }}
147175

148176
# ========== Release 创建 ==========
149177
create-release:
@@ -265,11 +293,44 @@ jobs:
265293
path: |
266294
src-tauri/binaries/rclone
267295
src-tauri/binaries/openlist
268-
src-tauri/binaries/rclone-${{ matrix.target }}${{ matrix.platform == 'windows-latest' && '.exe' || '' }}
269-
src-tauri/binaries/openlist-${{ matrix.target }}${{ matrix.platform == 'windows-latest' && '.exe' || '' }}
296+
src-tauri/binaries/rclone-${{ matrix.target }}${{ contains(matrix.platform, 'windows') && '.exe' || '' }}
297+
src-tauri/binaries/openlist-${{ matrix.target }}${{ contains(matrix.platform, 'windows') && '.exe' || '' }}
270298
src-tauri/binaries/winfsp.msi
271299
key: binaries-${{ matrix.target }}-${{ env.RCLONE_VERSION }}-${{ env.OPENLIST_VERSION }}
272300

301+
- name: Resolve skip-downloads flag
302+
id: resolve-skip-downloads
303+
shell: bash
304+
run: |
305+
set -euo pipefail
306+
if [ "${{ steps.cache-binaries.outputs.cache-hit }}" != "true" ]; then
307+
echo "skip_downloads=false" >> "$GITHUB_OUTPUT"
308+
exit 0
309+
fi
310+
311+
ext=""
312+
if [ "${{ contains(matrix.platform, 'windows') }}" = "true" ]; then
313+
ext=".exe"
314+
fi
315+
316+
has_rclone=false
317+
has_openlist=false
318+
319+
if [ -f "src-tauri/binaries/rclone${ext}" ] || [ -f "src-tauri/binaries/rclone-${{ matrix.target }}${ext}" ]; then
320+
has_rclone=true
321+
fi
322+
323+
if [ -f "src-tauri/binaries/openlist${ext}" ] || [ -f "src-tauri/binaries/openlist-${{ matrix.target }}${ext}" ]; then
324+
has_openlist=true
325+
fi
326+
327+
if [ "$has_rclone" = "true" ] && [ "$has_openlist" = "true" ]; then
328+
echo "skip_downloads=true" >> "$GITHUB_OUTPUT"
329+
else
330+
echo "skip_downloads=false" >> "$GITHUB_OUTPUT"
331+
echo "Cache hit but required binaries are missing for target ${{ matrix.target }}; downloads remain enabled."
332+
fi
333+
273334
- name: Install Linux dependencies
274335
if: contains(matrix.platform, 'ubuntu')
275336
run: |
@@ -288,7 +349,7 @@ jobs:
288349
# Tauri 签名私钥密码(如果密钥已加密)
289350
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
290351
# 使用缓存时跳过下载
291-
NETMOUNT_SKIP_BIN_DOWNLOADS: ${{ steps.cache-binaries.outputs.cache-hit }}
352+
NETMOUNT_SKIP_BIN_DOWNLOADS: ${{ steps.resolve-skip-downloads.outputs.skip_downloads }}
292353
with:
293354
releaseId: ${{ needs.create-release.outputs.release_id }}
294355
args: ${{ matrix.args }}

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "netmount"
33
description = "NetMount"
4-
version = "1.2.1"
4+
version = "1.2.2"
55
authors = ["VirtualHotBar"]
66
license = "AGPL-3.0"
77
repository = ""

0 commit comments

Comments
 (0)