Skip to content

Commit b7ef2d4

Browse files
committed
ci: extract artifact names from actual build output
1 parent 63f56a1 commit b7ef2d4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/build-release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ jobs:
9999
id: pkg_name
100100
shell: bash
101101
run: |
102-
# Find the first tar.gz or zip file and extract basename without extension
103-
PKG_FILE=$(ls pkg/*.tar.gz pkg/*.zip 2>/dev/null | head -1)
102+
# Find tar.gz or zip file (using find to avoid glob expansion issues)
103+
PKG_FILE=$(find pkg -maxdepth 1 -type f \( -name "*.tar.gz" -o -name "*.zip" \) | head -1)
104104
if [ -z "$PKG_FILE" ]; then
105105
echo "ERROR: No package file found"
106106
exit 1
107107
fi
108-
# Remove directory and extension(s) to get package name
109-
PKG_NAME=$(basename "$PKG_FILE" | sed -E 's/\.(tar\.gz|zip)$//')
108+
# Get basename and remove extensions using parameter expansion (portable)
109+
PKG_BASE=$(basename "$PKG_FILE")
110+
PKG_NAME="${PKG_BASE%.tar.gz}"
111+
PKG_NAME="${PKG_NAME%.zip}"
110112
echo "PACKAGE_NAME=$PKG_NAME" >> $GITHUB_OUTPUT
111113
echo "Package name: $PKG_NAME"
112114

0 commit comments

Comments
 (0)