Skip to content

Commit 459c8b1

Browse files
committed
🧬 Extract the tag and release info building process with Python project case as a single function.
1 parent 7296396 commit 459c8b1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

scripts/ci/build_git-tag_or_create_github-release.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,7 @@ ensure_release_tag_is_not_empty() {
242242
}
243243

244244

245-
# The truly running implementation of shell script
246-
if [ "$Input_Arg_Release_Type" == 'python-package' ]; then
247-
248-
# # # # For Python package release
249-
echo "🏃‍♂ ️🐍 𝌚 Run python package releasing process"
250-
245+
tag_and_release_python_project() {
251246
git_tag=$(git describe --tag --abbrev=0 --match "v[0-9]\.[0-9]\.[0-9]*" | grep -o '[0-9]\.[0-9]\.[0-9]*')
252247
github_release=$(curl -s https://api.github.com/repos/Chisanan232/GitHub-Action_Reusable_Workflows-Python/releases/latest | jq -r '.tag_name')
253248
# shellcheck disable=SC2002
@@ -308,7 +303,14 @@ if [ "$Input_Arg_Release_Type" == 'python-package' ]; then
308303
fi
309304

310305
fi
306+
}
307+
311308

309+
# The truly running implementation of shell script
310+
if [ "$Input_Arg_Release_Type" == 'python-package' ]; then
311+
# # # # For Python package release
312+
echo "🏃‍♂ ️🐍 𝌚 Run python package releasing process"
313+
tag_and_release_python_project
312314
elif [ "$Input_Arg_Release_Type" == 'github-action-reusable-workflow' ]; then
313315

314316
echo "🏃‍♂ 🐙 🐈 𝌚 Run github-action-reusable-workflow releasing process"

0 commit comments

Comments
 (0)