Skip to content

Commit 228f4f1

Browse files
committed
fix(ci): remove artifact size increase check to be less than 5% from previous release
1 parent c5b980d commit 228f4f1

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -285,55 +285,6 @@ jobs:
285285
LATEST_RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest)
286286
LATEST=$(echo "$LATEST_RELEASE" | jq -r '.name')
287287
288-
# Check artifact sizes against previous release
289-
if [ -n "$LATEST" ] && [ "$LATEST" != "null" ]; then
290-
echo "Checking artifact sizes against previous release: $LATEST"
291-
FAILED=0
292-
293-
for artifact in mcp-*-${VERSION}.*; do
294-
if [ ! -f "$artifact" ]; then
295-
continue
296-
fi
297-
298-
# Get current artifact size
299-
NEW_SIZE=$(stat -c%s "$artifact" 2>/dev/null || stat -f%z "$artifact")
300-
301-
# Get artifact name for previous release
302-
ARTIFACT_NAME=$(echo "$artifact" | sed "s/${VERSION}/${LATEST}/")
303-
304-
# Get previous artifact size from GitHub API
305-
OLD_SIZE=$(echo "$LATEST_RELEASE" | jq -r ".assets[] | select(.name == \"$(basename "$ARTIFACT_NAME")\") | .size")
306-
307-
if [ -z "$OLD_SIZE" ] || [ "$OLD_SIZE" = "null" ]; then
308-
echo "⚠️ Previous artifact not found: $(basename "$ARTIFACT_NAME"), skipping comparison"
309-
continue
310-
fi
311-
312-
# Calculate percentage increase
313-
INCREASE=$(awk "BEGIN {printf \"%.2f\", (($NEW_SIZE - $OLD_SIZE) / $OLD_SIZE) * 100}")
314-
315-
echo "📦 $artifact: $OLD_SIZE → $NEW_SIZE bytes (${INCREASE}% change)"
316-
317-
# Check if increase is more than 5%
318-
if (( $(echo "$INCREASE > 5" | bc -l) )); then
319-
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
320-
echo "⚠️ WARNING: $artifact size increased by ${INCREASE}% (limit: 5%)"
321-
else
322-
echo "❌ ERROR: $artifact size increased by ${INCREASE}% (limit: 5%)"
323-
FAILED=1
324-
fi
325-
fi
326-
done
327-
328-
if [ $FAILED -eq 1 ]; then
329-
echo ""
330-
echo "❌ One or more artifacts exceeded the 5% size increase limit"
331-
exit 1
332-
fi
333-
334-
echo "✅ All artifacts within 5% size increase limit"
335-
fi
336-
337288
if [[ "$VERSION" != "$LATEST" || "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
338289
echo "version=$VERSION" >> $GITHUB_OUTPUT
339290
else

0 commit comments

Comments
 (0)