diff options
author | Florian Zschocke <florian.zschocke@devolo.de> | 2020-01-26 16:47:44 +0100 |
---|---|---|
committer | Florian Zschocke <florian.zschocke@devolo.de> | 2020-01-27 21:48:20 +0100 |
commit | e0e23d872c625c8b5494c37b0e5b90475a3cee78 (patch) | |
tree | 1d5b28f6471509537daaf0d8177ba086b1923404 /src | |
parent | 8463244e78c9d6fdfed8ebb1227b9a9494219567 (diff) | |
download | gitblit-e0e23d872c625c8b5494c37b0e5b90475a3cee78.tar.gz gitblit-e0e23d872c625c8b5494c37b0e5b90475a3cee78.zip |
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.
Diffstat (limited to 'src')
-rwxr-xr-x | src/site/templates/ghreleasenotes.awk | 66 |
1 files changed, 66 insertions, 0 deletions
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</details>\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 "<details><summary>Fixes</summary>\n\n### Fixes\n" ; next} +on==1 && /^[[:blank:]]*changes:/ { skip=0 ; section=$1; printf "<details><summary>Changes</summary>\n\n### Changes\n" ; next} +on==1 && /^[[:blank:]]*additions:/ { skip=0 ; section=$1; printf "<details><summary>Additions</summary>\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 |