Skip to content

Commit cfec37c

Browse files
committed
fix(release.sh): Take version from CHANGELOG and allow beta versions
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent 178655a commit cfec37c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

release.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ if ! command -v gh > /dev/null; then
1212
fi
1313

1414
# Use version from changelog
15-
# version=$(head -n1 CHANGELOG.md|cut -d"v" -f2);
16-
version=$1
15+
version=$(grep '^## \[' CHANGELOG.md|head -n1|cut -d'[' -f2|cut -d']' -f1);
16+
# version=$1
1717
# The target branch, defaults to the current branch
1818
target=${2:-$(git branch --show-current)}
1919
# The tag
2020
tag=v$version
2121

22-
if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
22+
if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?$ ]]; then
2323
echo "Invalid version, please enter a valid semantic version"
2424
exit 1
2525
fi

0 commit comments

Comments
 (0)