1414 options :
1515 - patch
1616 - minor
17- workflow_call :
18- inputs :
19- release_ref :
20- description : Git ref to tag
21- required : true
22- default : main
23- type : string
24- bump :
25- description : Version bump type (patch or minor)
26- required : true
27- type : string
2817
2918permissions :
3019 contents : write
3120
32- env :
33- git_user_name : localstack[bot]
34- git_user_email : localstack-bot@users.noreply.github.com
35-
3621concurrency :
3722 group : create-release-tag
3823 cancel-in-progress : false
@@ -49,53 +34,10 @@ jobs:
4934 fetch-depth : 0
5035 token : ${{ secrets.PRO_ACCESS_TOKEN }}
5136
52- - name : Configure Git user
53- env :
54- GIT_USER_NAME : ${{ env.git_user_name }}
55- GIT_USER_EMAIL : ${{ env.git_user_email }}
56- run : |
57- git config user.name "${GIT_USER_NAME}"
58- git config user.email "${GIT_USER_EMAIL}"
59-
6037 - name : Fetch tags
6138 run : git fetch --tags --force
6239
63- - name : Compute next version tag
64- id : next_tag
65- env :
66- BUMP : ${{ inputs.bump }}
67- run : |
68- set -euo pipefail
69-
70- latest="$(git tag --list "v0.*.*" --sort=-v:refname | grep -E "^v0\.[0-9]+\.[0-9]+$" | head -n 1 || true)"
71- if [[ -z "${latest}" ]]; then
72- minor=1
73- patch=0
74- else
75- current_minor="$(echo "${latest}" | cut -d. -f2)"
76- current_patch="$(echo "${latest}" | cut -d. -f3)"
77- if [[ "${BUMP}" == "minor" ]]; then
78- minor="$(( current_minor + 1 ))"
79- patch=0
80- else
81- minor="${current_minor}"
82- patch="$(( current_patch + 1 ))"
83- fi
84- fi
85-
86- tag="v0.${minor}.${patch}"
87- if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then
88- echo "Tag ${tag} already exists"
89- exit 1
90- fi
91-
92- echo "tag=${tag}" >> "${GITHUB_OUTPUT}"
93-
94- - name : Create and push tag
95- run : |
96- tag="${{ steps.next_tag.outputs.tag }}"
97- git tag -a "${tag}" -m "Release ${tag}"
98- git push origin "${tag}"
99-
100- - name : Print created tag
101- run : echo "Created tag ${{ steps.next_tag.outputs.tag }}"
40+ - name : Create release tag
41+ uses : ./.github/actions/create-release-tag
42+ with :
43+ bump : ${{ inputs.bump }}
0 commit comments