emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient 0619c7ef19 08/17: Automatically publish stati


From: Jonas Bernoulli
Subject: [elpa] externals/transient 0619c7ef19 08/17: Automatically publish statistics
Date: Fri, 25 Mar 2022 06:22:15 -0400 (EDT)

branch: externals/transient
commit 0619c7ef198349c11c8ef598c7caa741b3c4c9b0
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Automatically publish statistics
---
 .github/workflows/stats.yml | 18 ++++++++++++++++++
 Makefile                    | 10 +++++++---
 docs/Makefile               | 18 +++++++++++++-----
 3 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/stats.yml b/.github/workflows/stats.yml
new file mode 100644
index 0000000000..96f261b489
--- /dev/null
+++ b/.github/workflows/stats.yml
@@ -0,0 +1,18 @@
+name: stats
+on:
+  push:
+    branches: master
+jobs:
+  manual:
+    name: "Generate and distribute statistics"
+    runs-on: ubuntu-latest
+    steps:
+      - name: Install gitstats
+        uses: magit/actions/install-gitstats@main
+      - name: Generate statistics
+        uses: magit/actions/stats-generate@main
+      - name: Publish statistics
+        uses: magit/actions/stats-publish@main
+        with:
+          key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
+          secret: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
diff --git a/Makefile b/Makefile
index 623c3486ad..2117e62215 100644
--- a/Makefile
+++ b/Makefile
@@ -14,9 +14,10 @@ help:
        $(info make html         - generate html manual file)
        $(info make html-dir     - generate html manual directory)
        $(info make pdf          - generate pdf manual)
-       $(info make stats        - generate statistics)
        $(info make publish      - publish snapshot manuals)
        $(info make release      - publish release manuals)
+       $(info make stats        - generate statistics)
+       $(info make stats-upload - publish statistics)
        $(info make clean        - remove most generated files)
        @printf "\n"
 
@@ -35,14 +36,17 @@ html-dir:
        @$(MAKE) -C docs html-dir
 pdf:
        @$(MAKE) -C docs pdf
-stats:
-       @$(MAKE) -C docs stats
 
 publish:
        @$(MAKE) -C docs publish
 release:
        @$(MAKE) VERSION=$(VERSION) -C docs release
 
+stats:
+       @$(MAKE) -C docs stats
+stats-upload:
+       @$(MAKE) -C docs stats-upload
+
 clean:
        @$(MAKE) -C lisp clean
        @$(MAKE) -C docs clean
diff --git a/docs/Makefile b/docs/Makefile
index 15c20aa42d..c0b03ded5f 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -52,11 +52,6 @@ html-dir: $(PKG).texi
        @printf "Generating $@\n"
        @texi2pdf --clean $< > /dev/null
 
-.PHONY: stats
-stats:
-       @printf "Generating statistics\n"
-       @gitstats $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
-
 PUBLISH_PATH   ?= /manual/
 RELEASE_PATH   ?= /manual/$(VERSION)/
 S3_BUCKET      ?= s3://$(DOMAIN)
@@ -86,6 +81,19 @@ release: html html-dir pdf
        @aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) 
--paths \
        "$(subst $(space),$(comma),$(addprefix 
$(RELEASE_PATH),$(CFRONT_PATHS)))" > /dev/null
 
+.PHONY: stats
+stats:
+       @printf "Generating statistics\n"
+       @$(GITSTATS) $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
+
+stats-upload:
+       @printf "Uploading statistics...\n"
+       @aws s3 sync $(GITSTATS_DIR) $(S3_BUCKET)/stats/$(PKG)
+       @printf "Uploaded to $(S3_BUCKET)/stats/$(PKG)\n"
+       @printf "Generating CDN invalidation\n"
+       @aws cloudfront create-invalidation \
+       --distribution-id $(CFRONT_DIST) --paths "/stats/*" > /dev/null
+
 CLEAN = $(PKG).info dir $(PKG) $(PKG).html $(PKG).pdf
 
 clean:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]