Skip to content

Commit f54d07e

Browse files
author
tumbler
committed
Fix workflow again
1 parent 774dcab commit f54d07e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/release-main.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ jobs:
2626
- uses: actions/checkout@v3
2727
with:
2828
fetch-depth: 0
29-
30-
- name: Extract Version Name
31-
run: echo "VERSION_NAME=${GITHUB_REF#refs/tags/release/}" >> $GITHUB_ENV
32-
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
3337
- name: Build and zip folder
3438
run: |
35-
blender_version=${VERSION_NAME}
36-
sed 's|"version":.*|"version": (${blender_version}),|' bms_blender_plugin/__init__.py > bms_blender_plugin/__init__.py.tmp
37-
mv bms_blender_plugin/__init__.py.tmp bms_blender_plugin/__init__.py
38-
zip -r "bms_blender_plugin-${blender_version}.zip" bms_blender_plugin/
39+
zip -r "bms_blender_plugin-${GITHUB_REF##*/}.zip" bms_blender_plugin/
3940
echo "Zip file built"
40-
4141
- name: Release
4242
uses: softprops/action-gh-release@v1
4343
with:
44-
tag_name: ${{ github.ref_name }}
45-
name: "Release ${{ github.ref_name }}"
44+
tag_name: ${{ github.ref }}
45+
name: "Release ${{ github.ref }}"
4646
files: |
47-
bms_blender_plugin*.zip
47+
bms_blender_plugin*.zip

0 commit comments

Comments
 (0)