Skip to content

Commit ac4b36e

Browse files
anobakaclaude
andcommitted
fix: CDN refresh sent literal "\n" instead of newline-separated paths
The bash double-quoted ObjectPath used "\n" as a path separator, which is a literal backslash-n rather than a newline, so Aliyun received a single malformed directory path and reported Complete without invalidating anything. Switched to a real multi-line string and added a post-refresh curl check that asserts the platform manifests actually serve the new version. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1fb4816 commit ac4b36e

1 file changed

Lines changed: 42 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ jobs:
115115
id: cdn-refresh
116116
run: |
117117
VERSION="${{ needs.prepare.outputs.version }}"
118+
OBJECT_PATH="https://cdn-public.anobaka.com/app/bakabase/releases/
119+
https://cdn-public.anobaka.com/app/bakabase/archives/${VERSION}/
120+
https://cdn-public.anobaka.com/app/bakabase/scripts/"
118121
RESULT=$(./aliyun cdn RefreshObjectCaches \
119-
--ObjectPath "https://cdn-public.anobaka.com/app/bakabase/releases/\nhttps://cdn-public.anobaka.com/app/bakabase/archives/${VERSION}/\nhttps://cdn-public.anobaka.com/app/bakabase/scripts/" \
122+
--ObjectPath "$OBJECT_PATH" \
120123
--ObjectType Directory)
121124
echo "$RESULT"
122125
TASK_ID=$(echo "$RESULT" | jq -r '.RefreshTaskId')
@@ -142,3 +145,41 @@ jobs:
142145
done
143146
echo "CDN refresh timed out after 2 minutes (task may still be processing)"
144147
exit 1
148+
149+
- name: Verify CDN serves new version
150+
run: |
151+
VERSION="${{ needs.prepare.outputs.version }}"
152+
v=$(echo "$VERSION" | tr '[:upper:]' '[:lower:]')
153+
if [[ "$v" == *beta* ]]; then
154+
MANIFEST=releases.beta.json
155+
elif [[ "$v" == *rc* ]]; then
156+
MANIFEST=releases.rc.json
157+
else
158+
MANIFEST=releases.json
159+
fi
160+
echo "Verifying manifest: $MANIFEST, expected version: $VERSION"
161+
162+
PLATFORMS=(win-x64 osx-x64 osx-arm64)
163+
FAILED=()
164+
for plat in "${PLATFORMS[@]}"; do
165+
URL="https://cdn-public.anobaka.com/app/bakabase/releases/${plat}/${MANIFEST}"
166+
OK=0
167+
for i in $(seq 1 6); do
168+
ACTUAL=$(curl -fsSL "$URL" | jq -r '.Assets[0].Version // empty' 2>/dev/null || echo "")
169+
echo "[$plat] attempt $i: got version='$ACTUAL', expected='$VERSION'"
170+
if [ "$ACTUAL" = "$VERSION" ]; then
171+
OK=1
172+
break
173+
fi
174+
sleep 5
175+
done
176+
if [ "$OK" -ne 1 ]; then
177+
FAILED+=("$plat")
178+
fi
179+
done
180+
181+
if [ "${#FAILED[@]}" -gt 0 ]; then
182+
echo "::error::CDN still serves stale manifest after 30s for: ${FAILED[*]}"
183+
exit 1
184+
fi
185+
echo "All platforms serve version $VERSION"

0 commit comments

Comments
 (0)