-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (55 loc) · 2.7 KB
/
Copy pathMakefile
File metadata and controls
69 lines (55 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.PHONY: build dev
build: assets
# compass compile
bundle exec jekyll build
dev:
bundle exec jekyll serve
assets: _includes/tables img/stats img/*.png
update-downloads:
python3 scripts/update-downloads.py
install-deps:
# This shouldn't be set in CI, but it's maybe (?) useful for local development
#bundle config set path 'vendor/bundle'
# we also need `pug`: npm install -g pug
bundle install
precommit:
# Used to optimize png filesizes (which need to be <128K due to https://github.com/DougBeney/Jekyll-Bliss/issues/4)
# If files are still >128K, then you might want reduce the number of colors and remove metadata to reduce size:
# convert $INPUT $OUTPUT -colors 256 -strip -define png:exclude-chunk=all
# optipng $INPUT $OUTPUT
img/%.png:
optipng -o5 $@
clean:
-rm -r _site
-rm -r _build
-rm -r _includes/tables
-make --directory=contributor-stats clean
#
# Build dependencies, not to be run manually
#
stats:
git clone --recurse-submodules https://github.com/ActivityWatch/stats.git || true
# Shallow clone: contributor-stats commits regenerated stats every few hours,
# so its history grows ~10MB/year; only the latest checkout is needed here
# (gitstats analyzes the AW repos it clones itself, not this repo's history).
contributor-stats:
git clone --depth 1 --recurse-submodules https://github.com/ActivityWatch/contributor-stats.git || true
_includes/tables: contributor-stats
make --directory=contributor-stats build-aw
cp -r contributor-stats/tables _includes/
# contributor-stats commits only its sync-state JSON, not the rendered
# table, so generate the GitHub stats table from that state here.
cd contributor-stats && poetry install --no-interaction
make --directory=contributor-stats render
cp contributor-stats/github-activity-table.html _includes/tables/github-stats.html
# The contributors avatar list (_data/contributors.yml) is likewise
# generated from the sync state, not hand-maintained.
cp contributor-stats/contributors.yml _data/contributors.yml
img/stats: stats
cd stats && poetry install
mkdir -p img/stats
mkdir -p stats/out
cd stats && poetry run python analyze_stats.py --since 2017-07-01 --column downloads --per-day --save ../img/stats/downloads.png
cd stats && poetry run python analyze_stats.py --since 2017-07-01 --column 'Chrome WAU' --title 'Chrome Weekly Active Users' --save ../img/stats/chrome-wau.png
cd stats && poetry run python analyze_stats.py --since 2017-07-01 --column 'Firefox DAU' --resample 7D --title 'Firefox Daily Active Users (7D mean)' --save ../img/stats/firefox-dau-7d.png
cd stats && poetry run python analyze_stats.py --since 2017-07-01 --column 'Android installed devices' --title 'Android Installed Devices' --save ../img/stats/android-devices.png