Skip to content

Commit 5243b8f

Browse files
committed
fix(release): improved release script
1 parent 3550c60 commit 5243b8f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ jobs:
2525
- id: get-package-source
2626
run: |
2727
tag="${GITHUB_REF#refs/tags/}"
28-
name_with_scope=$(echo "$tag" | cut -d'@' -f2-)
29-
scope=$(echo "$name_with_scope" | cut -d'/' -f1)
30-
name=$(echo "$name_with_scope" | cut -d'/' -f2 | cut -d'@' -f1)
28+
echo "Full tag: $tag"
29+
30+
# Strip both leading @ and version suffix
31+
pkg_path=$(echo "$tag" | sed -E 's/^@([^@]*)@([0-9]+\.[0-9]+\.[0-9]+)$/\1/')
32+
# pkg_path = firebase-ui/translations
33+
34+
scope=$(echo "$pkg_path" | cut -d'/' -f1)
35+
name=$(echo "$pkg_path" | cut -d'/' -f2)
3136
version=$(echo "$tag" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
3237
3338
echo "SCOPE=$scope" >> "$GITHUB_ENV"
@@ -36,6 +41,12 @@ jobs:
3641
echo "TAG=$tag" >> "$GITHUB_ENV"
3742
echo "file=releases/${scope}-${name}-${version}.tgz" >> "$GITHUB_OUTPUT"
3843
44+
echo "Parsed:"
45+
echo " Scope: $scope"
46+
echo " Package: $name"
47+
echo " Version: $version"
48+
echo " File path: releases/${scope}-${name}-${version}.tgz"
49+
3950
- run: pnpm --filter "@${{ env.SCOPE }}/${{ env.PACKAGE }}" run release
4051

4152
- uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)