mirror of
https://gitlab.com/schmiddi-on-mobile/flare.git
synced 2026-10-26 13:37:46 -04:00
add script to extract release notes from change log
This commit is contained in:
1 parent
acdd8b7ea6
commit
8d72ee8d68
2 files changed
+16
-2
No files matched your search
+1
-2
@@ -141,8 +141,7 @@ release:
|
||||
- upload
|
||||
script:
|
||||
- echo "Creating GitLab Release for ${CI_COMMIT_TAG}"
|
||||
- PREV_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null || echo "")
|
||||
- if [ -n "$PREV_TAG" ]; then git log --pretty=format:"- [%h](https://gitlab.com/${CI_PROJECT_PATH}/-/commit/%H) %s" ${PREV_TAG}..${CI_COMMIT_TAG} --no-merges > release_notes.md; else echo "Initial release" > release_notes.md; fi
|
||||
- sh ./build-aux/extract-changelog-for-tag.sh ./CHANGELOG.md ${CI_COMMIT_TAG} > release_notes.md
|
||||
release:
|
||||
name: "Release ${CI_COMMIT_TAG}"
|
||||
description: "$(cat release_notes.md)"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Usage: $0 <changelog file> <tag>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CHANGELOG_FILE=$1
|
||||
CURRENT_TAG=$2
|
||||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 "${CURRENT_TAG}"^)
|
||||
|
||||
# Extract content between the two tags
|
||||
awk "/^## \[${CURRENT_TAG}\] - / {flag=1; next} /^## \[${PREVIOUS_TAG}\] - / {flag=0; exit} flag" "${CHANGELOG_FILE}" |
|
||||
# Remove leading and trailing empty lines
|
||||
sed -e '1{/^$/d;}' -e '${/^$/d;}'
|
||||
Reference in new issue
Block a user