diff --git a/.circleci/scripts/release.sh b/.circleci/scripts/release.sh index ec72c05..ffc004a 100755 --- a/.circleci/scripts/release.sh +++ b/.circleci/scripts/release.sh @@ -5,7 +5,7 @@ github_namespace=$1 github_repository=$2 get_latest_tag() { - git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+" | cut -d"-" -f 1 | sort | tail -n 1 + git tag --sort=v:refname | grep -E "v[0-9]+\.[0-9]+\.[0-9]+" | tail -n 1 } latest_tag=$(get_latest_tag) diff --git a/.circleci/scripts/tag.sh b/.circleci/scripts/tag.sh index 1a7ab2d..fd0814e 100755 --- a/.circleci/scripts/tag.sh +++ b/.circleci/scripts/tag.sh @@ -4,11 +4,11 @@ set -e semver_regex_pattern="[0-9]+\.[0-9]+\.[0-9]+" latest_changelog_tag() { - grep -Po "(?<=\#\# \[)$semver_regex_pattern?(?=\])" CHANGELOG.md | cut -d"-" -f 1 | head -n 1 + grep -Po "(?<=\#\# \[)$semver_regex_pattern?(?=\])" CHANGELOG.md | head -n 1 } latest_git_tag() { - git tag -l | grep -E "^v$semver_regex_pattern" | cut -d"-" -f 1 | sort | tail -n 1 + git tag --sort=v:refname | grep -E "v$semver_regex_pattern" | tail -n 1 } tag_candidate="v$(latest_changelog_tag)" @@ -21,6 +21,10 @@ then echo "Pushing new semver tag to GitHub..." git tag "$tag_candidate" git push --tags + echo "Updating develop branch with new semver tag..." + git checkout develop + git merge "$tag_candidate" --ff --no-edit + git push origin develop else echo "Latest changelog tag ($tag_candidate) already released on GitHub. Tagging is not required." fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a01766..0410dbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.5] - 2023-01-11 + +### Updated + +- Updated `CI` scripts (tag/release) +- Updated download script + ## [2.0.4] - 2023-01-03 ### Updated diff --git a/script/download.sh b/script/download.sh index 716bf71..a42aa8e 100755 --- a/script/download.sh +++ b/script/download.sh @@ -7,7 +7,7 @@ ARCH_TYPE=".tar.gz" TAR_FILE="$BINARY_NAME$ARCH_TYPE" latest_release() { - curl -sL -o /dev/null -w '%{url_effective}' "$RELEASES_URL/latest" | rev | cut -f1 -d'/'| rev + curl -sL -o /dev/null -w '%{url_effective}' "$RELEASES_URL/latest" | rev | cut -f 1 -d '/'| rev } remove_tmp_download() {