Skip to content

Commit 495a5f3

Browse files
committed
fix: remove stray target search paths causing pipefail in CI rename steps
All post-build steps now exclusively search src-tauri/target (the canonical build output directory). The secondary "target" path was a workaround for the CARGO_TARGET_DIR doubled-path issue and is no longer needed; its presence caused find to return non-zero when the directory didn't exist, triggering pipefail.
1 parent 4626c96 commit 495a5f3

1 file changed

Lines changed: 16 additions & 30 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,19 @@ jobs:
119119
if: always()
120120
shell: bash
121121
run: |
122-
roots=()
123-
[[ -d "src-tauri/target" ]] && roots+=("src-tauri/target")
124-
[[ -d "target" ]] && roots+=("target")
125-
126-
if [[ ${#roots[@]} -gt 0 ]]; then
127-
echo "=== target roots: ${roots[*]} ==="
128-
for root in "${roots[@]}"; do
129-
find "$root" -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
130-
done
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
131125
else
132-
echo "No build output directory found in src-tauri/target or target."
126+
echo "No build output directory found in src-tauri/target."
133127
fi
134128
135129
- name: Rename macOS updater assets
136130
if: startsWith(matrix.platform, 'macos')
137131
shell: bash
138132
run: |
139133
set -euo pipefail
140-
if [[ ! -d "src-tauri/target" && ! -d "target" ]]; then
134+
if [[ ! -d "src-tauri/target" ]]; then
141135
echo "No build output, skipping rename"
142136
exit 0
143137
fi
@@ -153,7 +147,7 @@ jobs:
153147
ARCH_SUFFIX="x64"
154148
fi
155149
156-
find src-tauri/target target -type f -path "*/release/bundle/macos/*.app.tar.gz" 2>/dev/null | while read -r file; do
150+
find src-tauri/target -type f -path "*/release/bundle/macos/*.app.tar.gz" 2>/dev/null | while read -r file; do
157151
dir="$(dirname "$file")"
158152
base="$(basename "$file" ".app.tar.gz")"
159153
normalized_base="$(normalize_name "$base")"
@@ -165,7 +159,7 @@ jobs:
165159
fi
166160
done
167161
168-
find src-tauri/target target -type f -path "*/release/bundle/dmg/*.dmg" 2>/dev/null | while read -r file; do
162+
find src-tauri/target -type f -path "*/release/bundle/dmg/*.dmg" 2>/dev/null | while read -r file; do
169163
dir="$(dirname "$file")"
170164
name="$(basename "$file")"
171165
normalized_name="$(normalize_name "$name")"
@@ -180,7 +174,7 @@ jobs:
180174
shell: bash
181175
run: |
182176
set -euo pipefail
183-
if [[ ! -d "src-tauri/target" && ! -d "target" ]]; then
177+
if [[ ! -d "src-tauri/target" ]]; then
184178
echo "No build output, skipping rename"
185179
exit 0
186180
fi
@@ -190,7 +184,7 @@ jobs:
190184
printf '%s' "${filename// /_}"
191185
}
192186
193-
find src-tauri/target target -type f -path "*/release/bundle/nsis/*.exe" 2>/dev/null | while read -r file; do
187+
find src-tauri/target -type f -path "*/release/bundle/nsis/*.exe" 2>/dev/null | while read -r file; do
194188
dir="$(dirname "$file")"
195189
name="$(basename "$file")"
196190
normalized_name="$(normalize_name "$name")"
@@ -209,7 +203,7 @@ jobs:
209203
shell: bash
210204
run: |
211205
set -euo pipefail
212-
if [[ ! -d "src-tauri/target" && ! -d "target" ]]; then
206+
if [[ ! -d "src-tauri/target" ]]; then
213207
echo "No build output, skipping rename"
214208
exit 0
215209
fi
@@ -219,7 +213,7 @@ jobs:
219213
printf '%s' "${filename// /_}"
220214
}
221215
222-
find src-tauri/target target -type f -path "*/release/bundle/appimage/*.AppImage" 2>/dev/null | while read -r file; do
216+
find src-tauri/target -type f -path "*/release/bundle/appimage/*.AppImage" 2>/dev/null | while read -r file; do
223217
dir="$(dirname "$file")"
224218
name="$(basename "$file")"
225219
normalized_name="$(normalize_name "$name")"
@@ -229,7 +223,7 @@ jobs:
229223
fi
230224
done
231225
232-
find src-tauri/target target -type f -path "*/release/bundle/deb/*.deb" 2>/dev/null | while read -r file; do
226+
find src-tauri/target -type f -path "*/release/bundle/deb/*.deb" 2>/dev/null | while read -r file; do
233227
dir="$(dirname "$file")"
234228
name="$(basename "$file")"
235229
normalized_name="$(normalize_name "$name")"
@@ -244,20 +238,20 @@ jobs:
244238
run: |
245239
set -euo pipefail
246240
247-
if [[ ! -d "src-tauri/target" && ! -d "target" ]]; then
248-
echo "Build output directory not found (src-tauri/target or target)." >&2
241+
if [[ ! -d "src-tauri/target" ]]; then
242+
echo "Build output directory not found (src-tauri/target)." >&2
249243
exit 1
250244
fi
251245
252246
require_file() {
253247
local pattern="$1"
254248
local label="$2"
255249
local match
256-
match="$(find src-tauri/target target -type f -path "$pattern" 2>/dev/null | sort | head -n 1 || true)"
250+
match="$(find src-tauri/target -type f -path "$pattern" 2>/dev/null | sort | head -n 1 || true)"
257251
if [[ -z "$match" ]]; then
258252
echo "缺少 ${label}: ${pattern}" >&2
259253
echo "Available bundle files:" >&2
260-
find src-tauri/target target -type f -path "*/bundle/*" 2>/dev/null | head -50 >&2 || true
254+
find src-tauri/target -type f -path "*/bundle/*" 2>/dev/null | head -50 >&2 || true
261255
exit 1
262256
fi
263257
echo "${label}: ${match}"
@@ -297,14 +291,6 @@ jobs:
297291
src-tauri/target/**/release/bundle/nsis/*.sig
298292
src-tauri/target/**/release/bundle/appimage/*.AppImage
299293
src-tauri/target/**/release/bundle/deb/*.deb
300-
target/**/release/bundle/dmg/*.dmg
301-
target/**/release/bundle/dmg/*.sig
302-
target/**/release/bundle/macos/*.app.tar.gz
303-
target/**/release/bundle/macos/*.app.tar.gz.sig
304-
target/**/release/bundle/nsis/*.exe
305-
target/**/release/bundle/nsis/*.sig
306-
target/**/release/bundle/appimage/*.AppImage
307-
target/**/release/bundle/deb/*.deb
308294
if-no-files-found: error
309295

310296
publish-release:

0 commit comments

Comments
 (0)