[latex3-commits] [git/LaTeX3-latex3-latex3] master: Enable auto-editing CHANGELOG for l3kernel (1c3a94b)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Sep 24 08:31:51 CEST 2018
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/1c3a94b3ea63ff5ef1cf5d57ad15e797957159fa
>---------------------------------------------------------------
commit 1c3a94b3ea63ff5ef1cf5d57ad15e797957159fa
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Sep 24 07:31:51 2018 +0100
Enable auto-editing CHANGELOG for l3kernel
>---------------------------------------------------------------
1c3a94b3ea63ff5ef1cf5d57ad15e797957159fa
l3kernel/build.lua | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/l3kernel/build.lua b/l3kernel/build.lua
index 11903bf..0a50e78 100644
--- a/l3kernel/build.lua
+++ b/l3kernel/build.lua
@@ -23,7 +23,7 @@ installfiles =
sourcefiles = {"*.dtx", "*.ins"}
tagfiles =
{
- "*.dtx", "README.md",
+ "*.dtx", "CHANGELOG.md", "README.md",
"interface3.tex", "l3styleguide.tex",
"l3syntax-changes.tex", "source3.tex"
}
@@ -46,6 +46,7 @@ dofile(maindir .. "/build-config.lua")
-- Detail how to set the version automatically
function update_tag(file,content,tagname,tagdate)
local iso = "%d%d%d%d%-%d%d%-%d%d"
+ local url = "https://github.com/latex3/latex3/compare/"
if string.match(file,"expl3%.dtx$") then
content = string.gsub(content,
"\n\\def\\ExplFileDate{" .. iso .. "}%%\n",
@@ -60,6 +61,17 @@ function update_tag(file,content,tagname,tagdate)
"\n(%%*%s*)\\date{Released " .. iso .. "}\n",
"\n%1\\date{Released " .. tagname .. "}\n")
elseif string.match(file, "%.md$") then
+ if string.match(file,"CHANGELOG.md") then
+ local previous = string.match(content,"compare/(" .. iso .. ")%.%.%.HEAD")
+ if tagname == previous then return content end
+ content = string.gsub(content,
+ "## %[Unreleased%]",
+ "## [Unreleased]\n\n## [" .. tagname .."]")
+ return string.gsub(content,
+ iso .. "%.%.%.HEAD",
+ tagname .. "...HEAD\n[" .. tagname .. "]: " .. url .. previous
+ .. "..." .. tagname)
+ end
return string.gsub(content,
"\nRelease " .. iso .. "\n",
"\nRelease " .. tagname .. "\n")
More information about the latex3-commits
mailing list