@@ -206,12 +206,32 @@ jobs:
206
206
207
207
runs-on : ubuntu-latest
208
208
209
+ env :
210
+ file : TEST
211
+
209
212
steps :
210
213
- uses : actions/checkout@v4
211
214
212
215
- name : Download all artifacts
213
216
uses : actions/download-artifact@v4
214
217
218
+ - name : Set file name
219
+ if : startsWith(github.ref, 'refs/tags/')
220
+ run : echo "file=${{ github.ref_name }}" >> "$GITHUB_ENV"
221
+
222
+ - name : Rename artifacts
223
+ run : |
224
+ mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2019-${{ github.sha }}.7z vcpkg-x64-windows-2019-${{ env.file }}.7z
225
+ mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2022-${{ github.sha }}.7z vcpkg-x64-windows-2022-${{ env.file }}.7z
226
+ mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2019-pdb-${{ github.sha }}.7z vcpkg-x64-windows-2019-pdb-${{ env.file }}.7z
227
+ mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2022-pdb-${{ github.sha }}.7z vcpkg-x64-windows-2022-pdb-${{ env.file }}.7z
228
+
229
+ - name : Release
230
+ if : startsWith(github.ref, 'refs/tags/')
231
+ uses : softprops/action-gh-release@v2
232
+ with :
233
+ files : vcpkg-x64-windows-*-${{ env.file }}.7z
234
+
215
235
- name : Setup ssh-agent
216
236
env :
217
237
SSH_PRIVATE_KEY : ${{ secrets.SSH_PRIVATE_KEY }}
@@ -266,39 +286,44 @@ jobs:
266
286
if : ${{ env.SSH_PRIVATE_KEY == '' }}
267
287
run : git clone https://gitlab.com/OpenMW/openmw-deps.git
268
288
269
- - name : Move exported vcpkg packages and pdb files archive to openmw-deps repository
270
- run : mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-*-${{ github.sha }}.7z openmw-deps/windows/
289
+ - name : Generate files containing a download url and hash
290
+ run : |
291
+ for file in vcpkg-x64-windows-*-${{ env.file }}.7z; do
292
+ filename=`echo "$file" | sed -r 's/vcpkg-x64-windows-(.+)-${{ env.file }}.7z/vcpkg-x64-\1-${{ env.file }}.txt/'`
293
+ echo "${{ github.server_url }}/${{ github.repository }}/releases/download/${{ env.file }}/$file" > "openmw-deps/windows/$filename"
294
+ shasum -a 512 "$file" >> "openmw-deps/windows/$filename"
295
+ done
271
296
272
297
- name : Generate commit message
273
298
env :
274
299
GH_TOKEN : ${{ github.token }}
275
300
working-directory : ${{ github.workspace }}/openmw-deps
276
301
run : |
277
- echo Add vcpkg packages built at ${{ github.sha }} > commit_message.txt
302
+ echo Add vcpkg package urls built at ${{ github.sha }} > commit_message.txt
278
303
echo >> commit_message.txt
279
304
printf 'Pushed by ' >> commit_message.txt
280
305
url=$(gh run --repo ${{ github.repository }} view ${{ github.run_id }} --json jobs --jq '.jobs[] | select(.name == "push-dynamic") | .url')
281
306
echo "${url:?}" >> commit_message.txt
282
307
echo >> commit_message.txt
283
308
284
- - name : Commit exported vcpkg packages
309
+ - name : Commit generated metadata
285
310
working-directory : ${{ github.workspace }}/openmw-deps
286
311
run : |
287
- git checkout -b vcpkg-x64-${{ github.sha }}
288
- git add windows/vcpkg-x64-*-${{ github.sha }}.7z
312
+ git checkout -b vcpkg-x64-windows- ${{ github.sha }}
313
+ git add windows/vcpkg-x64-*-${{ env.file }}.txt
289
314
git commit -F commit_message.txt
290
315
291
316
- name : Verify commit to openmw-deps repository
292
317
if : ${{ steps.import_gpg.outputs.fingerprint != '' }}
293
318
working-directory : ${{ github.workspace }}/openmw-deps
294
319
run : git verify-commit HEAD
295
320
296
- - name : Push exported vcpkg packages to gitlab
321
+ - name : Push generated metadata to gitlab
297
322
env :
298
323
SSH_PRIVATE_KEY : ${{ secrets.SSH_PRIVATE_KEY }}
299
324
# Make sure only signed commits are pushed
300
325
if : ${{ vars.PUSH_URL != '' && env.SSH_PRIVATE_KEY != '' && steps.import_gpg.outputs.fingerprint != '' }}
301
326
working-directory : ${{ github.workspace }}/openmw-deps
302
327
run : |
303
328
git remote set-url --push origin "${{ vars.PUSH_URL }}"
304
- git push origin vcpkg-x64-${{ github.sha }}
329
+ git push origin vcpkg-x64-windows- ${{ github.sha }}
0 commit comments