File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments