@@ -2,7 +2,7 @@ name: Release
2
2
on :
3
3
push :
4
4
tags :
5
- - release/* *
5
+ - release/v*.*. *
6
6
7
7
jobs :
8
8
lint :
@@ -26,22 +26,18 @@ jobs:
26
26
- uses : actions/checkout@v3
27
27
with :
28
28
fetch-depth : 0
29
- - name : Update version in __init__.py
30
- run : |
31
- # Extract version from tag (e.g., release/1.2.3 -> 1 2 3)
32
- version="${GITHUB_REF##*/}"
33
- major=$(echo $version | cut -d. -f1)
34
- minor=$(echo $version | cut -d. -f2)
35
- patch=$(echo $version | cut -d. -f3)
36
- sed -i "s/\"version\":\s*(.*)/\"version\": ($major, $minor, $patch),/" bms_blender_plugin/__init__.py
37
29
- name : Build and zip folder
38
30
run : |
39
- zip -r "bms_blender_plugin-${GITHUB_REF##*/}.zip" bms_blender_plugin/
31
+ tag_version=$(echo "${GITHUB_REF#refs/tags/release/}")
32
+ version_tuple=$(echo "$tag_version" | awk -F'[v.]' '{print $2", "$3", "$4}')
33
+ sed -i "s/\"version\": .*/\"version\": (${version_tuple}),/" bms_blender_plugin/__init__.py
34
+ zip -r "bms_blender_plugin-${tag_version}.zip" bms_blender_plugin
40
35
echo "Zip file built"
36
+ echo "TAG_VERSION=$tag_version" >> $GITHUB_ENV
41
37
- name : Release
42
38
uses : softprops/action-gh-release@v1
43
39
with :
44
- tag_name : ${{ github.ref }}
45
- name : " Release ${{ github.ref }}"
40
+ tag_name : " release/ ${{ env.TAG_VERSION }}"
41
+ name : " ${{ env.TAG_VERSION }}"
46
42
files : |
47
43
bms_blender_plugin*.zip
0 commit comments