Skip to content

Commit f118149

Browse files
committed
add Git tag to release asset file names
1 parent 48812b5 commit f118149

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,27 @@ jobs:
233233
with:
234234
path: artifacts/
235235

236-
- name: Move all files to the same location
236+
- name: Move artifacts to the expected location
237237
run: |
238-
ls -R
239-
cd artifacts
240-
for i in */; do cp ${i}opendtu-onbattery-*.bin ./; done
238+
ls -lR artifacts/
239+
mkdir -p release-artifacts
240+
for i in artifacts/*/; do
241+
for file in ${i}opendtu-onbattery-*.bin; do
242+
filename=$(basename "${file}")
243+
tag_name=${GITHUB_REF#refs/tags/}
244+
new_filename="${filename#opendtu-onbattery-}"
245+
new_filename="opendtu-onbattery-${tag_name}-${new_filename}"
246+
cp -v "${file}" "release-artifacts/${new_filename}"
247+
done
248+
done
249+
ls -lR release-artifacts/
241250
242251
- name: Create release
243252
uses: softprops/action-gh-release@v2
244253
with:
245254
body: ${{steps.github_release.outputs.changelog}}
246255
draft: False
247256
files: |
248-
artifacts/*.zip, artifacts/*.bin
257+
release-artifacts/*.bin
249258
env:
250259
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

0 commit comments

Comments
 (0)