forked from helidon-io/helidon-build-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update release.sh to create a CLI release tag
Signed-off-by: tvallin <[email protected]>
- Loading branch information
Showing
1 changed file
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
;; | ||
|
@@ -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 | ||
|
||
|