summary refs log tree commit diff
path: root/build-aux
diff options
context:
space:
mode:
authorArun Isaac2021-09-28 02:00:12 +0530
committerArun Isaac2021-09-28 12:40:51 +0530
commitad378f30835f3144e43b9a94d555e072e0b6417c (patch)
tree7a632a3ce2bc14c11ee5c5bbe3657c012326eed4 /build-aux
parent48000f38d58a08cf9e1c915c2d93038162a602cb (diff)
downloadguile-email-ad378f30835f3144e43b9a94d555e072e0b6417c.tar.gz
guile-email-ad378f30835f3144e43b9a94d555e072e0b6417c.tar.lz
guile-email-ad378f30835f3144e43b9a94d555e072e0b6417c.zip
README: Use a dynamic block to list releases.
* README.org (Download): Replace releases with dynamic block.
* build-aux/build-website.el: Update dynamic blocks before exporting.
(org-dblock-write:releases): New function.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/build-website.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/build-aux/build-website.el b/build-aux/build-website.el
index f29662f..f8b8454 100644
--- a/build-aux/build-website.el
+++ b/build-aux/build-website.el
@@ -28,5 +28,24 @@
       org-html-head-include-scripts nil
       org-html-postamble nil)
 
+(defun org-dblock-write:releases (params)
+  "Dynamically write releases block."
+  (call-process "git" nil t nil
+                "for-each-ref" "--sort=-taggerdate"
+                (let ((release-file "./releases/guile-email-%(refname:short).tar.lz"))
+                  (format "--format=- %%(taggerdate:short) [[%s][%s]] [[%s.asc][GPG Signature]]"
+                          release-file
+                          (file-name-nondirectory release-file)
+                          release-file))
+                "refs/tags/v*")
+  ;; Fix tarball filenames.
+  (replace-string "guile-email-v" "guile-email-" nil nil nil t)
+  ;; Delete the v0.1.0 release line since we don't have a copy of the
+  ;; release tarball.
+  (search-forward "guile-email-0.1.0.tar.lz")
+  (beginning-of-line)
+  (kill-line))
+
 (with-current-buffer (find-file "README.org")
+  (org-update-all-dblocks)
   (org-export-to-file 'html "website/index.html"))