Skip to content

Commit bb0b77c

Browse files
committed
fix: support package@version tag format in release workflow
1 parent 6bb4568 commit bb0b77c

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/release-tag.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
tags:
66
- 'v*.*.*'
7+
- 'vue-pivottable@*.*.*'
8+
- '@vue-pivottable/*@*.*.*'
79

810
jobs:
911
release-production:
@@ -27,16 +29,31 @@ jobs:
2729
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
2830
2931
# Extract version from tag
30-
VERSION=${TAG_NAME#v}
32+
# Handle different tag formats:
33+
# - v1.2.3 -> 1.2.3
34+
# - [email protected] -> 1.2.3
35+
# - @vue-pivottable/[email protected] -> 1.2.3
36+
if [[ $TAG_NAME == v*.*.* ]]; then
37+
VERSION=${TAG_NAME#v}
38+
PACKAGE_NAME="vue-pivottable"
39+
elif [[ $TAG_NAME == *@*.*.* ]]; then
40+
VERSION=${TAG_NAME##*@}
41+
PACKAGE_NAME=${TAG_NAME%@*}
42+
else
43+
echo "❌ Unrecognized tag format: $TAG_NAME"
44+
exit 1
45+
fi
46+
3147
echo "version=$VERSION" >> $GITHUB_OUTPUT
48+
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
3249
3350
# Validate version format
3451
if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
3552
echo "❌ Invalid version format: $VERSION"
3653
exit 1
3754
fi
3855
39-
echo "✅ Valid tag: $TAG_NAME (version: $VERSION)"
56+
echo "✅ Valid tag: $TAG_NAME (package: $PACKAGE_NAME, version: $VERSION)"
4057
4158
- name: Setup Node.js
4259
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)