Skip to content

Commit 23bf647

Browse files
committed
file name display and path count test
1 parent 51edc92 commit 23bf647

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,20 @@ jobs:
107107
id: file_info
108108
run: |
109109
shopt -s extglob
110-
FILE_PATH=$(ls ${{ format('build-artifacts/{0}/build/libs/!(*-@(dev|sources)).jar', matrix.subproject_dir) }})
110+
FILE_PATHS=$(ls ${{ format('build-artifacts/{0}/build/libs/!(*-@(dev|sources)).jar', matrix.subproject_dir) }})
111+
if (( ${#FILE_PATHS[@]} != 1 )); then
112+
echo "Error: Found ${#FILE_PATHS[@]} files, expected exactly 1"
113+
exit 1
114+
else
115+
FILE_PATH=${FILE_PATHS[0]}
116+
fi
117+
118+
FILE_NAME=$(basename $FILE_PATH)
111119
FILE_HASH=$(sha256sum $FILE_PATH | awk '{ print $1 }')
112-
echo "File: $FILE_PATH"
113-
echo "SHA-256: $FILE_HASH"
114120
echo "path=$FILE_PATH" >> $GITHUB_OUTPUT
121+
echo "name=$FILE_NAME" >> $GITHUB_OUTPUT
115122
echo "hash=$FILE_HASH" >> $GITHUB_OUTPUT
123+
cat $GITHUB_OUTPUT
116124
117125
- name: Publish Minecraft Mods
118126
uses: Kir-Antipov/[email protected]
@@ -137,7 +145,10 @@ jobs:
137145
138146
-------
139147
140-
- SHA-256 of `${{ steps.file_info.outputs.path }}`: `${{ steps.file_info.outputs.hash }}`
148+
Build Information
149+
150+
- File name: `${{ steps.file_info.outputs.name }}`
151+
- SHA-256: `${{ steps.file_info.outputs.hash }}`
141152
- Built from: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
142153
143154
loaders: fabric

0 commit comments

Comments
 (0)