Added compression badge

This commit is contained in:
SwingTheVine 2025-07-27 11:11:25 -04:00
parent c526a3f92b
commit 98bee9ea8c
2 changed files with 10 additions and 0 deletions

View file

@ -51,6 +51,15 @@ jobs:
echo "README.md was not found. Skipping..."
fi
sed -i 's|\(Latest_Version-\)[^-\ ]*\(-lightblue\)|\1'$current_version'\2|' docs/README.md
- name: Update compression badge
run: |
dist_size=$(wc -c < dist/BlueMarble.user.js)
src_size=$(find src -name "*.js" -exec cat {} + | wc -c)
percentage=$(awk "BEGIN {printf \"%.2f\", ($dist_size * 100) / $src_size}")
echo "Compression: $percentage"
badge_url="https://img.shields.io/badge/Compression-${percentage}%25-blue"
sed -i -E 's#https://img.shields.io/badge/Compression-[^"]*#'"$badge_url"'#' docs/README.md
- name: Get the previous commit message
id: get-commit-message

View file

@ -38,6 +38,7 @@
<a href="" target="_blank"><img alt="Total Patches" src="https://img.shields.io/badge/Total_Patches-200-black?style=flat"></a>
<a href="" target="_blank"><img alt="Total Lines of Code" src="https://tokei.rs/b1/github/SwingTheVine/Wplace-BlueMarble?category=code"></a>
<a href="" target="_blank"><img alt="Total Comments" src="https://tokei.rs/b1/github/SwingTheVine/Wplace-BlueMarble?category=comments"></a>
<a href="" target="_blank"><img alt="Compression" src="https://img.shields.io/badge/Compression-0%25-blue"></a>
<a href="" target="_blank"><img alt="Build" src="https://github.com/SwingTheVine/Wplace-BlueMarble/actions/workflows/build.yml/badge.svg"></a>
<a href="" target="_blank"><img alt="CodeQL" src="https://github.com/SwingTheVine/Wplace-BlueMarble/actions/workflows/github-code-scanning/codeql/badge.svg"></a>