@@ -475,46 +475,6 @@ jobs:
475475 LATEST_RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest)
476476 LATEST=$(echo "$LATEST_RELEASE" | jq -r '.name')
477477
478- if [ -n "$LATEST" ] && [ "$LATEST" != "null" ]; then
479- echo "Checking artifact sizes against previous release: $LATEST"
480- FAILED=0
481-
482- for artifact in memory-*-${VERSION}.*; do
483- if [ ! -f "$artifact" ]; then
484- continue
485- fi
486-
487- NEW_SIZE=$(stat -c%s "$artifact" 2>/dev/null || stat -f%z "$artifact")
488- ARTIFACT_NAME=$(echo "$artifact" | sed "s/${VERSION}/${LATEST}/")
489- OLD_SIZE=$(echo "$LATEST_RELEASE" | jq -r ".assets[] | select(.name == \"$(basename "$ARTIFACT_NAME")\") | .size")
490-
491- if [ -z "$OLD_SIZE" ] || [ "$OLD_SIZE" = "null" ]; then
492- echo "⚠️ Previous artifact not found: $(basename "$ARTIFACT_NAME"), skipping comparison"
493- continue
494- fi
495-
496- INCREASE=$(awk "BEGIN {printf \"%.2f\", (($NEW_SIZE - $OLD_SIZE) / $OLD_SIZE) * 100}")
497- echo "📦 $artifact: $OLD_SIZE → $NEW_SIZE bytes (${INCREASE}% change)"
498-
499- if (( $(echo "$INCREASE > 5" | bc -l) )); then
500- if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
501- echo "⚠️ WARNING: $artifact size increased by ${INCREASE}% (limit: 5%)"
502- else
503- echo "❌ ERROR: $artifact size increased by ${INCREASE}% (limit: 5%)"
504- FAILED=1
505- fi
506- fi
507- done
508-
509- if [ $FAILED -eq 1 ]; then
510- echo ""
511- echo "❌ One or more artifacts exceeded the 5% size increase limit"
512- exit 1
513- fi
514-
515- echo "✅ All artifacts within 5% size increase limit"
516- fi
517-
518478 if [[ "$VERSION" != "$LATEST" || "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
519479 echo "version=$VERSION" >> $GITHUB_OUTPUT
520480 else
0 commit comments