summaryrefslogtreecommitdiff
path: root/azure-pipelines/changelog.sh
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-01-05 20:11:29 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-01-13 11:31:04 +0000
commit750927372f7d10f648aa2015193d1f7f800f3a69 (patch)
treeed3390b353c7be6393b6af762e4a5b0e7b98647f /azure-pipelines/changelog.sh
parent52a66e4dd3ed3831d0bfa02ecde72e6f2a491e05 (diff)
downloadopenttd-750927372f7d10f648aa2015193d1f7f800f3a69.tar.xz
Add: [AzurePipeline] introducing a release pipeline
This release pipeline creates all the official release binaries, and publishes them as artifacts. Currently it can only produce nightlies and custom builds; stable/testing release binaries are untested. This commit also splits up the pipeline in small bits, to both improve readability, and to share code with the CI pipeline where possible.
Diffstat (limited to 'azure-pipelines/changelog.sh')
-rwxr-xr-xazure-pipelines/changelog.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/azure-pipelines/changelog.sh b/azure-pipelines/changelog.sh
new file mode 100755
index 000000000..71bc56fac
--- /dev/null
+++ b/azure-pipelines/changelog.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+tag=$(git describe --tags 2>/dev/null)
+
+# If we are a tag, show the part of the changelog that matches the tag.
+# In case of a stable, also show all betas and RCs.
+if [ -n "$tag" ]; then
+ grep="."
+ if [ "$(echo $tag | grep '-')" = "" ]; then
+ grep='^[0-9]\.[0-9]\.[0-9][^-]'
+ fi
+ next=$(cat changelog.txt | grep '^[0-9]' | awk 'BEGIN { show="false" } // { if (show=="true") print $0; if ($1=="'$tag'") show="true"} ' | grep "$grep" | head -n1 | sed 's/ .*//')
+ cat changelog.txt | awk 'BEGIN { show="false" } /^[0-9].[0-9].[0-9]/ { if ($1=="'$next'") show="false"; if ($1=="'$tag'") show="true";} // { if (show=="true") print $0 }'
+ exit 0
+fi
+
+# In all other cases, show the git log of the last 7 days
+revdate=$(git log -1 --pretty=format:"%ci")
+last_week=$(date -u -d "$revdate -7days" +"%Y-%m-%d %H:%M")
+git log --after="${last_week}" --pretty=fuller