Skip to content

Commit ef4d752

Browse files
committed
fix: use workspace target dir (target/) instead of src-tauri/target
The project uses a Cargo workspace (root Cargo.toml), which means all build artifacts go to ./target/ — not src-tauri/target/. The workflow was still referencing the pre-workspace path, causing every post-build step to fail.
1 parent 495a5f3 commit ef4d752

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,19 @@ jobs:
119119
if: always()
120120
shell: bash
121121
run: |
122-
if [[ -d "src-tauri/target" ]]; then
123-
echo "=== src-tauri/target ==="
124-
find src-tauri/target -maxdepth 5 -type f \( -name "*.app" -o -name "*.dmg" -o -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.tar.gz" -o -name "*.sig" \) 2>/dev/null || true
122+
if [[ -d "target" ]]; then
123+
echo "=== target ==="
124+
find target -maxdepth 5 -type f \( -name "*.app" -o -name "*.dmg" -o -name "*.exe" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.tar.gz" -o -name "*.sig" \) 2>/dev/null || true
125125
else
126-
echo "No build output directory found in src-tauri/target."
126+
echo "No build output directory found in target."
127127
fi
128128
129129
- name: Rename macOS updater assets
130130
if: startsWith(matrix.platform, 'macos')
131131
shell: bash
132132
run: |
133133
set -euo pipefail
134-
if [[ ! -d "src-tauri/target" ]]; then
134+
if [[ ! -d "target" ]]; then
135135
echo "No build output, skipping rename"
136136
exit 0
137137
fi
@@ -147,7 +147,7 @@ jobs:
147147
ARCH_SUFFIX="x64"
148148
fi
149149
150-
find src-tauri/target -type f -path "*/release/bundle/macos/*.app.tar.gz" 2>/dev/null | while read -r file; do
150+
find target -type f -path "*/release/bundle/macos/*.app.tar.gz" 2>/dev/null | while read -r file; do
151151
dir="$(dirname "$file")"
152152
base="$(basename "$file" ".app.tar.gz")"
153153
normalized_base="$(normalize_name "$base")"
@@ -159,7 +159,7 @@ jobs:
159159
fi
160160
done
161161
162-
find src-tauri/target -type f -path "*/release/bundle/dmg/*.dmg" 2>/dev/null | while read -r file; do
162+
find target -type f -path "*/release/bundle/dmg/*.dmg" 2>/dev/null | while read -r file; do
163163
dir="$(dirname "$file")"
164164
name="$(basename "$file")"
165165
normalized_name="$(normalize_name "$name")"
@@ -174,7 +174,7 @@ jobs:
174174
shell: bash
175175
run: |
176176
set -euo pipefail
177-
if [[ ! -d "src-tauri/target" ]]; then
177+
if [[ ! -d "target" ]]; then
178178
echo "No build output, skipping rename"
179179
exit 0
180180
fi
@@ -184,7 +184,7 @@ jobs:
184184
printf '%s' "${filename// /_}"
185185
}
186186
187-
find src-tauri/target -type f -path "*/release/bundle/nsis/*.exe" 2>/dev/null | while read -r file; do
187+
find target -type f -path "*/release/bundle/nsis/*.exe" 2>/dev/null | while read -r file; do
188188
dir="$(dirname "$file")"
189189
name="$(basename "$file")"
190190
normalized_name="$(normalize_name "$name")"
@@ -203,7 +203,7 @@ jobs:
203203
shell: bash
204204
run: |
205205
set -euo pipefail
206-
if [[ ! -d "src-tauri/target" ]]; then
206+
if [[ ! -d "target" ]]; then
207207
echo "No build output, skipping rename"
208208
exit 0
209209
fi
@@ -213,7 +213,7 @@ jobs:
213213
printf '%s' "${filename// /_}"
214214
}
215215
216-
find src-tauri/target -type f -path "*/release/bundle/appimage/*.AppImage" 2>/dev/null | while read -r file; do
216+
find target -type f -path "*/release/bundle/appimage/*.AppImage" 2>/dev/null | while read -r file; do
217217
dir="$(dirname "$file")"
218218
name="$(basename "$file")"
219219
normalized_name="$(normalize_name "$name")"
@@ -223,7 +223,7 @@ jobs:
223223
fi
224224
done
225225
226-
find src-tauri/target -type f -path "*/release/bundle/deb/*.deb" 2>/dev/null | while read -r file; do
226+
find target -type f -path "*/release/bundle/deb/*.deb" 2>/dev/null | while read -r file; do
227227
dir="$(dirname "$file")"
228228
name="$(basename "$file")"
229229
normalized_name="$(normalize_name "$name")"
@@ -238,20 +238,20 @@ jobs:
238238
run: |
239239
set -euo pipefail
240240
241-
if [[ ! -d "src-tauri/target" ]]; then
242-
echo "Build output directory not found (src-tauri/target)." >&2
241+
if [[ ! -d "target" ]]; then
242+
echo "Build output directory not found (target)." >&2
243243
exit 1
244244
fi
245245
246246
require_file() {
247247
local pattern="$1"
248248
local label="$2"
249249
local match
250-
match="$(find src-tauri/target -type f -path "$pattern" 2>/dev/null | sort | head -n 1 || true)"
250+
match="$(find target -type f -path "$pattern" 2>/dev/null | sort | head -n 1 || true)"
251251
if [[ -z "$match" ]]; then
252252
echo "缺少 ${label}: ${pattern}" >&2
253253
echo "Available bundle files:" >&2
254-
find src-tauri/target -type f -path "*/bundle/*" 2>/dev/null | head -50 >&2 || true
254+
find target -type f -path "*/bundle/*" 2>/dev/null | head -50 >&2 || true
255255
exit 1
256256
fi
257257
echo "${label}: ${match}"
@@ -283,14 +283,14 @@ jobs:
283283
with:
284284
name: release-assets-${{ matrix.platform }}-${{ strategy.job-index }}
285285
path: |
286-
src-tauri/target/**/release/bundle/dmg/*.dmg
287-
src-tauri/target/**/release/bundle/dmg/*.sig
288-
src-tauri/target/**/release/bundle/macos/*.app.tar.gz
289-
src-tauri/target/**/release/bundle/macos/*.app.tar.gz.sig
290-
src-tauri/target/**/release/bundle/nsis/*.exe
291-
src-tauri/target/**/release/bundle/nsis/*.sig
292-
src-tauri/target/**/release/bundle/appimage/*.AppImage
293-
src-tauri/target/**/release/bundle/deb/*.deb
286+
target/**/release/bundle/dmg/*.dmg
287+
target/**/release/bundle/dmg/*.sig
288+
target/**/release/bundle/macos/*.app.tar.gz
289+
target/**/release/bundle/macos/*.app.tar.gz.sig
290+
target/**/release/bundle/nsis/*.exe
291+
target/**/release/bundle/nsis/*.sig
292+
target/**/release/bundle/appimage/*.AppImage
293+
target/**/release/bundle/deb/*.deb
294294
if-no-files-found: error
295295

296296
publish-release:

0 commit comments

Comments
 (0)