build: add a script to find previous release version tag
This commit is contained in:
parent
e4ce9e1111
commit
5bdb85b04f
|
@ -1,7 +1,11 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
latest_release=$(git describe --abbrev=0 --tags --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*' --exclude '*docker*')
|
# ensure dir
|
||||||
|
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
|
||||||
|
|
||||||
|
# match any official release tag 'e*' and 'v*'
|
||||||
|
latest_release="$(env PREV_TAG_MATCH_PATTERN='*' ./scripts/find-prev-rel-tag.sh)"
|
||||||
echo "Version check compare base: $latest_release"
|
echo "Version check compare base: $latest_release"
|
||||||
|
|
||||||
bad_app_count=0
|
bad_app_count=0
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ -z "${PREV_TAG_MATCH_PATTERN:-}" ]; then
|
||||||
|
PROFILE="${PROFILE:-${1:-}}"
|
||||||
|
case "$PROFILE" in
|
||||||
|
emqx-enterprise*)
|
||||||
|
PREV_TAG_MATCH_PATTERN='e*'
|
||||||
|
;;
|
||||||
|
emqx*)
|
||||||
|
PREV_TAG_MATCH_PATTERN='v*'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown profile '$PROFILE'"
|
||||||
|
echo "Usage: $0 PROFILE"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
git describe --abbrev=0 --tags --match "${PREV_TAG_MATCH_PATTERN}" --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*' --exclude '*docker*'
|
|
@ -236,11 +236,7 @@ fi
|
||||||
generate_changelog () {
|
generate_changelog () {
|
||||||
local from_tag="${PREV_TAG:-}"
|
local from_tag="${PREV_TAG:-}"
|
||||||
if [[ -z $from_tag ]]; then
|
if [[ -z $from_tag ]]; then
|
||||||
if [ $PROFILE == "emqx" ]; then
|
from_tag="$(./scripts/find-prev-rel-tag.sh "$PROFILE")"
|
||||||
from_tag="$(git describe --tags --abbrev=0 --match 'v*')"
|
|
||||||
else
|
|
||||||
from_tag="$(git describe --tags --abbrev=0 --match 'e*')"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
./scripts/rel/format-changelog.sh -b "${from_tag}" -l 'en' -v "$TAG" > "changes/${TAG}.en.md"
|
./scripts/rel/format-changelog.sh -b "${from_tag}" -l 'en' -v "$TAG" > "changes/${TAG}.en.md"
|
||||||
./scripts/rel/format-changelog.sh -b "${from_tag}" -l 'zh' -v "$TAG" > "changes/${TAG}.zh.md"
|
./scripts/rel/format-changelog.sh -b "${from_tag}" -l 'zh' -v "$TAG" > "changes/${TAG}.zh.md"
|
||||||
|
|
|
@ -40,7 +40,7 @@ esac
|
||||||
## e4.3.11
|
## e4.3.11
|
||||||
## rel-v4.4.3
|
## rel-v4.4.3
|
||||||
## rel-e4.4.3
|
## rel-e4.4.3
|
||||||
PREV_TAG="${PREV_TAG:-$(git describe --tag --abbrev=0 --match "[${TAG_PREFIX}|rel-]*" --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*')}"
|
PREV_TAG="${PREV_TAG:-$(env PREV_TAG_MATCH_PATTERN="[${TAG_PREFIX}|rel-]*" ./scripts/find-prev-rel-tag.sh)}"
|
||||||
|
|
||||||
shift 1
|
shift 1
|
||||||
# bash 3.2 treat empty array as unbound, so we can't use 'ESCRIPT_ARGS=()' here,
|
# bash 3.2 treat empty array as unbound, so we can't use 'ESCRIPT_ARGS=()' here,
|
||||||
|
|
Loading…
Reference in New Issue