Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/release-stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
set -euo pipefail
files=(
docs/assets/release-downloads-by-platform.svg
docs/assets/release-downloads-by-version.svg
docs/assets/release-downloads-monthly.svg
docs/assets/release-downloads.md
docs/assets/release-downloads-history.jsonl
)
Expand All @@ -71,7 +71,13 @@ jobs:
mkdir -p "${tmp}/$(dirname "${f}")"
cp "${f}" "${tmp}/${f}"
done
git checkout -- "${files[@]}"
for f in "${files[@]}"; do
if git ls-files --error-unmatch "${f}" >/dev/null 2>&1; then
git checkout -- "${f}"
else
rm -f "${f}"
fi
done

if git fetch origin release-stats-data:refs/remotes/origin/release-stats-data; then
git checkout -B release-stats-data refs/remotes/origin/release-stats-data
Expand All @@ -81,10 +87,19 @@ jobs:
fi

for f in "${files[@]}"; do
mkdir -p "$(dirname "${f}")"
cp "${tmp}/${f}" "${f}"
done

git add "${files[@]}"
# Drop superseded charts so the data branch does not keep stale SVGs.
for stale in \
docs/assets/release-downloads-by-version.svg \
docs/assets/release-downloads-weekly.svg; do
if [ -f "${stale}" ]; then
git rm -f "${stale}"
fi
done
if git diff --cached --quiet; then
echo "Release stats already up to date."
exit 0
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ Release download counts aggregated from
[`bitdynamics-ab/canton-devkit`](https://github.com/bitdynamics-ab/canton-devkit/releases)
and
[`bitdynamics-ab/homebrew-canton-devkit`](https://github.com/bitdynamics-ab/homebrew-canton-devkit/releases)
(merged by tag). Charts refresh daily via
(merged by tag). The monthly chart is derived from daily cumulative
snapshots (GitHub exposes only current totals). Charts refresh daily via
[`release-stats.yml`](.github/workflows/release-stats.yml); checksum
files are excluded from the counts. Exact numbers:
[release-downloads.md](https://github.com/bitdynamics-ab/canton-devkit/blob/release-stats-data/docs/assets/release-downloads.md).

<img src="https://raw.githubusercontent.com/bitdynamics-ab/canton-devkit/release-stats-data/docs/assets/release-downloads-by-version.svg" alt="Total downloads per release over time" width="720" />
<img src="https://raw.githubusercontent.com/bitdynamics-ab/canton-devkit/release-stats-data/docs/assets/release-downloads-monthly.svg" alt="Monthly release downloads" width="720" />

<img src="https://raw.githubusercontent.com/bitdynamics-ab/canton-devkit/release-stats-data/docs/assets/release-downloads-by-platform.svg" alt="All-time downloads per platform" width="720" />

Expand Down
12 changes: 6 additions & 6 deletions docs/assets/release-downloads-by-platform.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 0 additions & 76 deletions docs/assets/release-downloads-by-version.svg

This file was deleted.

Loading