Skip to content

Commit 63f56a1

Browse files
committed
ci: use actual package filenames for artifact names
1 parent d5e8d94 commit 63f56a1

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/build-release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,25 @@ jobs:
9595
echo "Built packages:"
9696
ls -lh pkg/
9797
98+
- name: Extract package name
99+
id: pkg_name
100+
shell: bash
101+
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)
104+
if [ -z "$PKG_FILE" ]; then
105+
echo "ERROR: No package file found"
106+
exit 1
107+
fi
108+
# Remove directory and extension(s) to get package name
109+
PKG_NAME=$(basename "$PKG_FILE" | sed -E 's/\.(tar\.gz|zip)$//')
110+
echo "PACKAGE_NAME=$PKG_NAME" >> $GITHUB_OUTPUT
111+
echo "Package name: $PKG_NAME"
112+
98113
- name: Upload artifacts
99114
uses: actions/upload-artifact@v4
100115
with:
101-
name: dnsdiag-${{ matrix.platform }}-bin
116+
name: ${{ steps.pkg_name.outputs.PACKAGE_NAME }}
102117
path: |
103118
pkg/*.tar.gz
104119
pkg/*.zip

0 commit comments

Comments
 (0)