From e0e23d872c625c8b5494c37b0e5b90475a3cee78 Mon Sep 17 00:00:00 2001 From: Florian Zschocke Date: Sun, 26 Jan 2020 16:47:44 +0100 Subject: Add deployment of a release to GitHub Add Ant tasks and macros to deploy binaries to GitHub, using GitHub's releases. Adds an Awk script to extract GH flavoured markdown release notes from the release.moxie file. Adds `ok.sh` to the repository so that it is readily available. This is a Bourne shell GitHub API client, used to create a release on GitHub and upload the binaries. --- src/site/templates/ghreleasenotes.awk | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 src/site/templates/ghreleasenotes.awk (limited to 'src') diff --git a/src/site/templates/ghreleasenotes.awk b/src/site/templates/ghreleasenotes.awk new file mode 100755 index 00000000..f4479552 --- /dev/null +++ b/src/site/templates/ghreleasenotes.awk @@ -0,0 +1,66 @@ +#! /usr/bin/env awk -f + +BEGIN { on=0 ; skip=1 ; block=0 ; section=""} + +/^[[:blank:]]*id:/ { relId = $NF } + +/r[0-9]+: *{/ { on=1 ; next } +/^[[:blank:]]*}[[:blank:]]*$/ { if (on) { + print "[Full release notes on gitblit.com](http://gitblit.com/releases.html#" relId ")" + exit 0 + } + } + + +on==1 && /^[[:blank:]]*[[:alnum:]]+:[[:blank:]]*(''|~)?$/ { + if (!block) { + skip=1 + if (section == "fixes:" || section == "changes:" || section == "additions:") { printf "\n\n"} + if (section != "") print "" + if (section == "note:") print "----------" + section = "" + if ($NF == "~") next + } + else { + printSection() + next + } + if ($NF == "''") { + block = !block + } + } +on==1 && /^[[:blank:]]*note:/ { skip=0 ; section=$1; print "### Update Note" ; printSingleLineSection() ; next } +on==1 && /^[[:blank:]]*text:/ { skip=0 ; section=$1; printf "\n\n"; printSingleLineSection() ; next } +on==1 && /^[[:blank:]]*security:/ { skip=0 ; section=$1; print "### *Security*" ; next } +on==1 && /^[[:blank:]]*fixes:/ { skip=0 ; section=$1; printf "
Fixes\n\n### Fixes\n" ; next} +on==1 && /^[[:blank:]]*changes:/ { skip=0 ; section=$1; printf "
Changes\n\n### Changes\n" ; next} +on==1 && /^[[:blank:]]*additions:/ { skip=0 ; section=$1; printf "
Additions\n\n### Additions\n" ; next} + +on==1 { + if ($1 == "''") { + block = !block + next + } + if ((block || !skip)) { + printSection() + } + } + +function printSingleLineSection() +{ + if (NF>1 && $2 != "''" && $2 != "~") { + if (protect) gsub(/'/, "'\\''") + for (i=2; i<= NF; i++) printf "%s ", $i + print "" + } +} + +function printSection() +{ + if (section != "text:") sub(/[[:blank:]]+/, "") + gsub(/pr-/, "PR #") + gsub(/issue-/, "issue #") + gsub(/commit-/, "commit ") + if (protect) gsub(/'/, "'\\''") + print $0 +} \ No newline at end of file -- cgit v1.2.3