Skip to content

Commit

Permalink
update release.sh to create a CLI release tag
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <[email protected]>
  • Loading branch information
tvallin committed Jan 2, 2025
1 parent ae40c9a commit 7c0fc4b
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions etc/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ $(basename "${0}") [ --build-number=N ] CMD
Print the release version
create_tag
Create and and push a release tag
Create and push a release tag
create_cli_tag
Create and push a CLI release tag
release_build
Perform a release build
Expand All @@ -72,7 +75,7 @@ while (( ${#} > 0 )); do
usage
exit 0
;;
"update_version"|"release_version"|"create_tag"|"release_build")
"update_version"|"release_version"|"create_tag"|"release_build"|"create_cli_tag")
COMMAND="${1}"
shift
;;
Expand Down Expand Up @@ -169,6 +172,34 @@ create_tag() {
echo "tag=refs/tags/${version}" >&6
}

create_cli_tag() {
local git_branch version cli_tag

version=$(release_version)
cli_tag="cli/${version}"
git_branch="release/${cli_tag}"

# Use a separate branch
git branch -D "${git_branch}" > /dev/null 2>&1 || true
git checkout -b "${git_branch}"

# Invoke update_version
update_version "${version}"

# Git user info
git config user.email || git config --global user.email "[email protected]"
git config user.name || git config --global user.name "Helidon Robot"

# Commit version changes
git commit -a -m "Release ${cli_tag}"

# Create and push a git tag
git tag -f "${cli_tag}"
git push --force origin refs/tags/"${cli_tag}":refs/tags/"${cli_tag}"

echo "tag=refs/tags/${cli_tag}" >&6
}

release_build(){
local tmpfile version

Expand Down

0 comments on commit 7c0fc4b

Please sign in to comment.