Skip to content

Commit 1741a9e

Browse files
committed
♻️ Refactor the CI step about using shell script to run the process generates release version info.
1 parent 1041f49 commit 1741a9e

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/rw_build_git-tag_and_create_github-release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ jobs:
7575
uses: actions/checkout@v4
7676

7777
- name: Download shell script for checking input parameters
78-
run: curl https://raw.githubusercontent.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/develop/scripts/ci/build_git-tag_or_create_github-release.sh --output ./scripts/ci/build_git-tag_or_create_github-release.sh
78+
run: |
79+
curl https://raw.githubusercontent.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/develop/scripts/ci/build_git-tag_or_create_github-release.sh --output ./scripts/ci/build_git-tag_or_create_github-release.sh
80+
curl https://raw.githubusercontent.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/develop/scripts/ci/generate_release_info.sh --output ./scripts/ci/generate_release_info.sh
7981
8082
# This flow for the project type is Python project
8183
- name: Build git tag and create GitHub release for Python project
@@ -97,10 +99,8 @@ jobs:
9799
if: ${{ inputs.project_type == 'github-action-reusable-workflow' }}
98100
id: github_action_reusable_workflow_release
99101
run: |
100-
release=$(bash ./scripts/ci/build_git-tag_or_create_github-release.sh ${{ inputs.project_type }} ${{ inputs.debug_mode }})
101-
echo "📄 Release log: $release"
102-
103-
release_version=$(echo "$release" | grep -E "\[GitHub Action - Reusable workflow\] \[Final Running Result\] (Official\-Release and version: ([0-9]{1,})|(Pre\-Release))" | grep -E -o "(([0-9]{1,})|(Pre\-Release))")
102+
release_info=$(bash ./scripts/ci/generate_release_info.sh ${{ inputs.project_type }} ${{ inputs.debug_mode }})
103+
release_version=$(echo "$release_info" | grep -E "Target version which would be pass to deployment process: ([0-9]{1,})|(Pre\-Release))" | grep -E -o "(([0-9]{1,})|(Pre\-Release))")
104104
echo "🤖 Release Version: $release_version"
105105
106106
echo "release_version=$(echo $release_version)" >> $GITHUB_OUTPUT
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Input_Arg_Project_Type=$1
2+
Input_Arg_Debug_Mode=$2
3+
4+
release=$(bash ./scripts/ci/build_git-tag_or_create_github-release.sh "$Input_Arg_Project_Type" "$Input_Arg_Debug_Mode")
5+
echo "📄 Release log: $release"
6+
7+
release_version=$(echo "$release" | grep -E "\[GitHub Action - Reusable workflow\] \[Final Running Result\] (Official\-Release and version: ([0-9]{1,})|(Pre\-Release))" | grep -E -o "(([0-9]{1,})|(Pre\-Release))")
8+
echo " 📲 Target version which would be pass to deployment process: $release_version"

0 commit comments

Comments
 (0)