diff --git a/.gitignore b/.gitignore index dda88e80..50fdfc56 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ bin public dcd d-scanner +extract_last_changelog_part diff --git a/setup/build-release.sh b/setup/build-release.sh index 065cfe73..8be0ea51 100644 --- a/setup/build-release.sh +++ b/setup/build-release.sh @@ -102,7 +102,8 @@ if [ ! -z "$GITLAB_CI" ]; then ZP2_NAME="dexed.$ver.linux64.zip" # read the log - LOG=$(grep -Poz "##[\s\S]*?(?=# v)" ../CHANGELOG.md) # capture all starting from "##" and until "# v" + ldc2 extract_last_changelog_part.d + LOG=$(./extract_last_changelog_part) LOG=$(echo "$LOG" | sed -z 's/\n/\\n/g' | sed -z 's/\"/\\"/g') ASSET_RPM='{ "name" : "'$RPM_NAME'" , "url" : "'$LNK_BASE$RPM_NAME'" , "filepath" : "/binaries/'$RPM_NAME'" }' diff --git a/setup/extract_last_changelog_part.d b/setup/extract_last_changelog_part.d new file mode 100644 index 00000000..f749a190 --- /dev/null +++ b/setup/extract_last_changelog_part.d @@ -0,0 +1,15 @@ +module extract_last_changelog_part; + +void main() +{ + import std.regex : matchFirst; + import std.file : readText; + import std.stdio : write; + import std.string : strip; + + readText("../CHANGELOG.md") + .matchFirst(`##[\s\S]*?(?=# v)`) + .front + .strip + .write; +}