88
88
uses : actions/download-artifact@v4
89
89
- name : Build universal
90
90
run : |
91
+ if [ "$VER" = "master" ]; then
92
+ VER=0.0.0-dev
93
+ fi
94
+
91
95
export WORKDIR=$PWD/build/darwin/universal/$VER
92
96
mkdir -p $WORKDIR
93
97
@@ -182,10 +186,8 @@ jobs:
182
186
request_rate : 4
183
187
files : |
184
188
./scan/*
185
- - name : Add VirusTotal Info
186
- run : |
187
- echo '${{ toJSON(steps.virustotal.outputs) }}'
188
- - name : Draft Release
189
+ - name : Generate Release Notes
190
+ id : generate_release_notes
189
191
uses : softprops/action-gh-release@v2
190
192
if : startsWith(github.ref, 'refs/tags/v')
191
193
with :
@@ -195,3 +197,36 @@ jobs:
195
197
files : |
196
198
dist-*/*/*/*.tar.bz2
197
199
dist-*/*/*/*.zip
200
+ - name : Add VirusTotal Info to Release Notes
201
+ if : startsWith(github.ref, 'refs/tags/v')
202
+ run : |
203
+ # get release notes
204
+ url=https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.generate_release_notes.outputs.id }}
205
+ body=$(
206
+ curl \
207
+ -L \
208
+ -H "Accept: application/vnd.github+json" \
209
+ -H "Authorization: Bearer $GITHUB_TOKEN" \
210
+ -H "X-GitHub-Api-Version: 2022-11-28" \
211
+ $url \
212
+ | jq -r .body
213
+ )
214
+
215
+ # append virustotal details to release notes
216
+ nl=$'\n'
217
+ body+="$nl[VirusTotal](https://www.virustotal.com) analysis:$nl"
218
+ while read -r -d, line; do
219
+ name=$(sed -e 's/^\.\/scan\/\([^=]\+\)=.*/\1/' <<< "$line")
220
+ vturl=$(sed -e 's/.*=\(https.*\)/\1/' <<< "$line")
221
+ body+="* [$name]($vturl)$nl"
222
+ done <<< "$a"
223
+
224
+ # update release notes
225
+ curl \
226
+ -L \
227
+ -X PATCH \
228
+ -H "Accept: application/vnd.github+json" \
229
+ -H "Authorization: Bearer $GITHUB_TOKEN" \
230
+ -H "X-GitHub-Api-Version: 2022-11-28" \
231
+ -d "{\"body\": \"$body\"}" \
232
+ $url
0 commit comments