@@ -240,55 +240,6 @@ jobs:
240240 LATEST_RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest)
241241 LATEST=$(echo "$LATEST_RELEASE" | jq -r '.name')
242242
243- # Check artifact sizes against previous release
244- if [ -n "$LATEST" ] && [ "$LATEST" != "null" ]; then
245- echo "Checking artifact sizes against previous release: $LATEST"
246- FAILED=0
247-
248- for artifact in vector-*-${VERSION}.*; do
249- if [ ! -f "$artifact" ]; then
250- continue
251- fi
252-
253- # Get current artifact size
254- NEW_SIZE=$(stat -c%s "$artifact" 2>/dev/null || stat -f%z "$artifact")
255-
256- # Get artifact name for previous release
257- ARTIFACT_NAME=$(echo "$artifact" | sed "s/${VERSION}/${LATEST}/")
258-
259- # Get previous artifact size from GitHub API
260- OLD_SIZE=$(echo "$LATEST_RELEASE" | jq -r ".assets[] | select(.name == \"$(basename "$ARTIFACT_NAME")\") | .size")
261-
262- if [ -z "$OLD_SIZE" ] || [ "$OLD_SIZE" = "null" ]; then
263- echo "⚠️ Previous artifact not found: $(basename "$ARTIFACT_NAME"), skipping comparison"
264- continue
265- fi
266-
267- # Calculate percentage increase
268- INCREASE=$(awk "BEGIN {printf \"%.2f\", (($NEW_SIZE - $OLD_SIZE) / $OLD_SIZE) * 100}")
269-
270- echo "📦 $artifact: $OLD_SIZE → $NEW_SIZE bytes (${INCREASE}% change)"
271-
272- # Check if increase is more than 5%
273- if (( $(echo "$INCREASE > 5" | bc -l) )); then
274- if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
275- echo "⚠️ WARNING: $artifact size increased by ${INCREASE}% (limit: 5%)"
276- else
277- echo "❌ ERROR: $artifact size increased by ${INCREASE}% (limit: 5%)"
278- FAILED=1
279- fi
280- fi
281- done
282-
283- if [ $FAILED -eq 1 ]; then
284- echo ""
285- echo "❌ One or more artifacts exceeded the 5% size increase limit"
286- exit 1
287- fi
288-
289- echo "✅ All artifacts within 5% size increase limit"
290- fi
291-
292243 if [[ "$VERSION" != "$LATEST" || "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
293244 echo "version=$VERSION" >> $GITHUB_OUTPUT
294245 else
0 commit comments