forked from mgsxx/QEverCloudGenerator
-
Notifications
You must be signed in to change notification settings - Fork 1
688 lines (629 loc) · 27.5 KB
/
build_and_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
name: Build
on:
push:
paths-ignore:
- 'README.md'
- 'LICENSE'
branches:
- master
- development
tags:
- v[0-9].[0-9].[0-9]*
pull_request:
branches:
- master
- development
jobs:
build_linux:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- qt_version: '5.12.8'
compiler_c: 'gcc'
compiler_cpp: 'g++'
- qt_version: '5.12.8'
compiler_c: 'clang'
compiler_cpp: 'clang++'
- qt_version: '5.15.4'
compiler_c: 'gcc'
compiler_cpp: 'g++'
- qt_version: '5.15.4'
compiler_c: 'clang'
compiler_cpp: 'clang++'
steps:
- uses: actions/checkout@v4
- name: Install non-Qt dependencies
id: install_non_qt_deps
run: |
sudo apt-get -qq update
sudo apt-get -qq install cmake ninja-build p7zip-full coreutils curl
- name: Install gcc
id: install_gcc
run: |
sudo apt-get -qq install gcc g++
if: ${{ matrix.compiler_cpp == 'g++' }}
- name: Install clang
id: install_clang
run: |
sudo apt-get -qq install clang
if: ${{ matrix.compiler_cpp == 'clang++' }}
- name: Install Qt 5.12.8
id: install_qt_old
run: |
sudo apt-get -qq install qtbase5-dev qttools5-dev qttools5-dev-tools
if: ${{ matrix.qt_version == '5.12.8' }}
- name: Install Qt 5.15.4
id: install_qt_modern
run: |
sudo apt-add-repository -y ppa:beineri/opt-qt-5.15.4-focal
sudo apt-get -qq update
sudo apt-get -qq install qt515tools qt515base mesa-common-dev libgl1-mesa-dev
if: ${{ matrix.qt_version == '5.15.4' }}
shell: bash
- name: Configure for gcc and Qt 5.12.8
id: configure_for_gcc_and_qt_old
run: |
mkdir $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ ..
if: ${{ matrix.compiler_cpp == 'g++' && matrix.qt_version == '5.12.8' }}
- name: Configure for gcc and Qt 5.15.4
id: configure_for_gcc_and_qt_modern
run: |
mkdir $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_PREFIX_PATH=/opt/qt515 ..
if: ${{ matrix.compiler_cpp == 'g++' && matrix.qt_version == '5.15.4' }}
- name: Configure for clang and Qt 5.12.8
id: configure_for_clang_and_qt_old
run: |
mkdir $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ ..
if: ${{ matrix.compiler_cpp == 'clang++' && matrix.qt_version == '5.12.8' }}
- name: Configure for clang and Qt 5.15.4
id: configure_for_clang_and_qt_modern
run: |
mkdir $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_PREFIX_PATH=/opt/qt515 ..
if: ${{ matrix.compiler_cpp == 'clang++' && matrix.qt_version == '5.15.4' }}
- name: Build and install
id: build_and_install
run: |
cd $GITHUB_WORKSPACE/build
cmake --build . --target all
cmake --build . --target install
- name: Upload QEverCloudGenerator artifact
id: upload_artifact
uses: actions/upload-artifact@v4
with:
name: QEverCloudGenerator_linux
path: '${{ github.workspace }}/build/installdir/bin/QEverCloudGenerator'
if: ${{ matrix.qt_version == '5.15.4' && matrix.compiler_cpp == 'g++' }}
build_macos:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.30.x'
- name: Setup ninja
env:
RUNNER_WORKSPACE: ${{ runner.workspace }}
run: |
mkdir -p $RUNNER_WORKSPACE/ninja
cd $RUNNER_WORKSPACE/ninja
curl -fsSL https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-mac.zip -o ninja-mac.zip
unzip ninja-mac.zip
echo "$RUNNER_WORKSPACE/ninja" >> $GITHUB_PATH
- name: Cache Qt 5.15.2
id: cache_qt5
uses: actions/cache@v4
with:
path: '${{ runner.workspace }}/Qt5'
key: ${{ runner.os }}-Qt5Cache
- name: Install Qt 5.15.2
id: install_qt5
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: ${{ runner.os }}-Qt5Cache
version: 5.15.2
host: mac
target: desktop
install-deps: true
arch: clang_64
dir: '${{ runner.workspace }}/Qt5'
- name: Build and install
id: build_and_install
env:
RUNNER_WORKSPACE: ${{ runner.workspace }}
run: |
mkdir $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir -DCMAKE_PREFIX_PATH=$RUNNER_WORKSPACE/Qt5/Qt/5.15.2/clang_64 ..
cmake --build . --target all
cmake --build . --target install
- name: Upload QEverCloudGenerator artifact
id: upload_artifact
uses: actions/upload-artifact@v4
with:
name: QEverCloudGenerator_macos
path: ${{ github.workspace }}/build/installdir/bin/QEverCloudGenerator
build_windows:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: windows-2019
strategy:
matrix:
include:
- target_arch: 'x86'
- target_arch: 'x64'
steps:
- uses: actions/checkout@v4
- name: Cache Qt 5.15.2 x86
id: cache_qt_x86
uses: actions/cache@v4
with:
path: '${{ runner.workspace }}/Qt_x86'
key: ${{ runner.os }}-QtCache-x86
if: ${{ matrix.target_arch == 'x86' }}
- name: Install Qt 5.15.2 x86
id: install_qt_modern_x86
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-x86-1
version: 5.15.2
host: windows
target: desktop
install-deps: true
arch: win32_msvc2019
dir: '${{ runner.workspace }}/Qt_x86'
if: ${{ matrix.target_arch == 'x86' }}
- name: Cache Qt 5.15.2 x64
id: cache_qt_x64
uses: actions/cache@v4
with:
path: '${{ runner.workspace }}/Qt_x64'
key: ${{ runner.os }}-QtCache-x64
if: ${{ matrix.target_arch == 'x64' }}
- name: Install Qt 5.15.2 x64
id: install_qt_modern_x64
uses: jurplel/install-qt-action@v3
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-x64-1
version: 5.15.2
host: windows
target: desktop
install-deps: true
arch: win64_msvc2019_64
dir: '${{ runner.workspace }}/Qt_x64'
if: ${{ matrix.target_arch == 'x64' }}
- name: Build and install x86
id: build_and_install_x86
run: |
set CMAKE_PREFIX_PATH="%RUNNER_WORKSPACE%\Qt_x86\Qt\5.15.2\win32_msvc2019"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
cd %GITHUB_WORKSPACE%
md build
cd build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%\build\installdir" -DCMAKE_PREFIX_PATH="%CMAKE_PREFIX_PATH%" ..
cmake --build . --target all
cmake --build . --target install
if: ${{ matrix.target_arch == 'x86' }}
shell: cmd
- name: Build and install x64
id: build_and_install_x64
run: |
set CMAKE_PREFIX_PATH="%RUNNER_WORKSPACE%\Qt_x64\Qt\5.15.2\win64_msvc2019_x64"
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd %GITHUB_WORKSPACE%
md build
cd build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="%GITHUB_WORKSPACE%\build\installdir" -DCMAKE_PREFIX_PATH="%CMAKE_PREFIX_PATH%" ..
cmake --build . --target all
cmake --build . --target install
if: ${{ matrix.target_arch == 'x64' }}
shell: cmd
- name: Upload x86 QEverCloudGenerator
id: upload_artifact_x86
uses: actions/upload-artifact@v4
with:
name: QEverCloudGenerator_windows_x86
path: '${{ github.workspace }}\build\installdir\bin\QEverCloudGenerator.exe'
if: ${{ matrix.target_arch == 'x86' }}
- name: Upload x64 QEverCloudGenerator
id: upload_artifact_x64
uses: actions/upload-artifact@v4
with:
name: QEverCloudGenerator_windows_x64
path: '${{ github.workspace }}\build\installdir\bin\QEverCloudGenerator.exe'
if: ${{ matrix.target_arch == 'x64' }}
create_new_release:
if: ${{ github.event_name == 'push' && !contains(github.event.head_commit.message, '[skip ci]') }}
runs-on: ubuntu-latest
needs: [build_linux, build_macos, build_windows]
steps:
- name: Install dependencies
id: install_deps
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 23F3D4EA75716059
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
sudo apt update
sudo apt install -qq gh
sudo apt install -qq jq
sudo apt install -qq p7zip
sudo apt install -qq curl
- name: Delete previous continuous release
id: delete_previous_continuous_release
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export BRANCH_NAME=$(echo $GITHUB_REF | sed 's/.*\/\(.*\)$/\1/')
gh api /repos/d1vanov/QEverCloudGenerator/releases/tags/continuous-${BRANCH_NAME} > /tmp/gh_get_release.json && exit_status=$? || exit_status=$?
if [ "${exit_status}" = 0 ]; then
export COMMIT_SHA=$(cat /tmp/gh_get_release.json | jq '.target_commitish');
if ! [ "${COMMIT_SHA}" = "${GITHUB_SHA}" ]; then
export PREVIOUS_CONTINUOUS_RELEASE_DELETED=0
for i in {1..10}
do
echo "Trying to delete previous continuous release continuous-${BRANCH_NAME}"
gh release delete continuous-${BRANCH_NAME} -y -R d1vanov/QEverCloudGenerator;
curl -X DELETE -H "Authorization: token ${GITHUB_TOKEN}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/d1vanov/QEverCloudGenerator/git/refs/tags/continuous-${BRANCH_NAME};
gh api /repos/d1vanov/QEverCloudGenerator/releases/tags/continuous-${BRANCH_NAME} > /tmp/gh_get_release.json && exit_status=$? || exit_status=$?
if [ "${exit_status}" != 0 ]; then
echo "It appears that previous continuous release is deleted now"
export PREVIOUS_CONTINUOUS_RELEASE_DELETED=1
break
fi
echo "Was able to receive information about the attempted to be deleted previous continuous release, waiting for 5 seconds before the next attempt"
sleep 5
done
if [ "$PREVIOUS_CONTINUOUS_RELEASE_DELETED" != "1" ]; then
echo "Failed to delete previous continuous release after several attempts!"
fi
fi
fi
shell: bash
- name: Create new continuous master release
id: create_new_continuous_master_release
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create continuous-master --draft=false --prerelease --title "Continuous build (continuous-master)" --target $GITHUB_SHA -R d1vanov/QEverCloudGenerator
- name: Create new continuous development release
id: create_new_continuous_development_release
if: ${{ github.ref == 'refs/heads/development' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create continuous-development --draft=false --prerelease --title "Continuous build (continuous-development)" --target $GITHUB_SHA -R d1vanov/QEverCloudGenerator
- name: Create new tagged release
id: create_new_tagged_release
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REF: ${{ github.ref }}
GITHUB_REF_NAME: ${{ github.ref_name }}
run: |
gh release create "$GITHUB_REF" --draft=false --title "Release build ($GITHUB_REF_NAME)" --target $GITHUB_SHA -R d1vanov/QEverCloudGenerator
- name: Download linux artifact
id: download_linux_artifact
uses: actions/download-artifact@v4
with:
name: QEverCloudGenerator_linux
path: '${{ github.workspace }}/artifacts/linux/QEverCloudGenerator'
- name: Download macOS artifact
id: download_macos_artifact
uses: actions/download-artifact@v4
with:
name: QEverCloudGenerator_macos
path: '${{ github.workspace }}/artifacts/macos/QEverCloudGenerator'
- name: Download Windows x86 artifact
id: download_windows_x86_artifact
uses: actions/download-artifact@v4
with:
name: QEverCloudGenerator_windows_x86
path: '${{ github.workspace }}/artifacts/windows/x86/QEverCloudGenerator.exe'
- name: Download Windows x64 artifact
id: download_windows_x64_artifact
uses: actions/download-artifact@v4
with:
name: QEverCloudGenerator_windows_x64
path: '${{ github.workspace }}/artifacts/windows/x64/QEverCloudGenerator.exe'
- name: Compress Linux artifact
id: compress_linux_artifact
run: |
7z a $GITHUB_WORKSPACE/artifacts/linux/QEverCloudGenerator.zip $GITHUB_WORKSPACE/artifacts/linux/QEverCloudGenerator
- name: Compress macOS artifact
id: compress_macos_artifact
run: |
7z a $GITHUB_WORKSPACE/artifacts/macos/QEverCloudGenerator.zip $GITHUB_WORKSPACE/artifacts/macos/QEverCloudGenerator
- name: Compress Windows x86 artifact
id: compress_windows_x86_artifact
run: |
7z a $GITHUB_WORKSPACE/artifacts/windows/x86/QEverCloudGenerator.zip $GITHUB_WORKSPACE/artifacts/windows/x86/QEverCloudGenerator.exe
- name: Compress Windows x64 artifact
id: compress_windows_x64_artifact
run: |
7z a $GITHUB_WORKSPACE/artifacts/windows/x64/QEverCloudGenerator.zip $GITHUB_WORKSPACE/artifacts/windows/x64/QEverCloudGenerator.exe
- name: Upload Linux artifact to continuous master release
id: upload_linux_artifact_to_continuous_master_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv $GITHUB_WORKSPACE/artifacts/linux/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_linux_x86_64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber continuous-master /tmp/QEverCloudGenerator_linux_x86_64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref == 'refs/heads/master' }}
shell: bash
- name: Upload Linux artifact to continuous development release
id: upload_linux_artifact_to_continuous_development_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv $GITHUB_WORKSPACE/artifacts/linux/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_linux_x86_64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber continuous-development /tmp/QEverCloudGenerator_linux_x86_64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref == 'refs/heads/development' }}
shell: bash
- name: Upload macOS artifact to continuous master release
id: upload_macos_artifact_to_continuous_master_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv $GITHUB_WORKSPACE/artifacts/macos/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_macos_x86_64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber continuous-master /tmp/QEverCloudGenerator_macos_x86_64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref == 'refs/heads/master' }}
shell: bash
- name: Upload macOS artifact to continuous development release
id: upload_macos_artifact_to_continuous_development_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv $GITHUB_WORKSPACE/artifacts/macos/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_macos_x86_64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber continuous-development /tmp/QEverCloudGenerator_macos_x86_64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref == 'refs/heads/development' }}
shell: bash
- name: Upload Windows x86 artifact to continuous master release
id: upload_windows_x86_artifact_to_continuous_master_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv $GITHUB_WORKSPACE/artifacts/windows/x86/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_windows_x86.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber continuous-master /tmp/QEverCloudGenerator_windows_x86.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref == 'refs/heads/master' }}
shell: bash
- name: Upload Windows x86 artifact to continuous development release
id: upload_windows_x86_artifact_to_continuous_development_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv $GITHUB_WORKSPACE/artifacts/windows/x86/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_windows_x86.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber continuous-development /tmp/QEverCloudGenerator_windows_x86.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref == 'refs/heads/development' }}
shell: bash
- name: Upload Windows x64 artifact to continuous master release
id: upload_windows_x64_artifact_to_continuous_master_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv $GITHUB_WORKSPACE/artifacts/windows/x64/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_windows_x64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber continuous-master /tmp/QEverCloudGenerator_windows_x64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref == 'refs/heads/master' }}
shell: bash
- name: Upload Windows x64 artifact to continuous development release
id: upload_windows_x64_artifact_to_continuous_development_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv $GITHUB_WORKSPACE/artifacts/windows/x64/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_windows_x64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber continuous-development /tmp/QEverCloudGenerator_windows_x64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref == 'refs/heads/development' }}
shell: bash
- name: Ensure continuous master release is not a draft
id: ensure_continuous_master_is_not_a_draft
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REF: ${{ github.ref }}
run: |
gh release edit continuous-master --draft=false -R d1vanov/QEverCloudGenerator
- name: Ensure continuous development release is not a draft
id: ensure_continuous_development_is_not_a_draft
if: ${{ github.ref == 'refs/heads/development' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REF: ${{ github.ref }}
run: |
gh release edit continuous-development --draft=false -R d1vanov/QEverCloudGenerator
- name: Upload Linux artifact to tagged release
id: upload_linux_artifact_to_tagged_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAG_NAME=$(echo $GITHUB_REF | sed 's/.*\/\(.*\)$/\1/')
mv $GITHUB_WORKSPACE/artifacts/linux/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_linux_x86_64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber ${TAG_NAME} /tmp/QEverCloudGenerator_linux_x86_64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' }}
shell: bash
- name: Upload macOS artifact to tagged release
id: upload_macos_artifact_to_tagged_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAG_NAME=$(echo $GITHUB_REF | sed 's/.*\/\(.*\)$/\1/')
mv $GITHUB_WORKSPACE/artifacts/macos/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_macos_x86_64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber ${TAG_NAME} /tmp/QEverCloudGenerator_macos_x86_64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' }}
shell: bash
- name: Upload Windows x86 artifact to tagged release
id: upload_windows_x86_artifact_to_tagged_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAG_NAME=$(echo $GITHUB_REF | sed 's/.*\/\(.*\)$/\1/')
mv $GITHUB_WORKSPACE/artifacts/windows/x86/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_windows_x86.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber ${TAG_NAME} /tmp/QEverCloudGenerator_windows_x86.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' }}
shell: bash
- name: Upload Windows x64 artifact to tagged release
id: upload_windows_x64_artifact_to_tagged_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAG_NAME=$(echo $GITHUB_REF | sed 's/.*\/\(.*\)$/\1/')
mv $GITHUB_WORKSPACE/artifacts/windows/x64/QEverCloudGenerator.zip /tmp/QEverCloudGenerator_windows_x64.zip
for i in 0..3
do
export UPLOADED=0
gh release upload --clobber ${TAG_NAME} /tmp/QEverCloudGenerator_windows_x64.zip -R d1vanov/QEverCloudGenerator && export UPLOADED=1 || true
if [ "$UPLOADED" = "1" ]; then
break
fi
done
if [ "$UPLOADED" != "1" ]; then
echo "Failed to upload artifact to release"
exit 1
fi
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' }}
shell: bash
- name: Ensure tagged release is not a draft
id: ensure_tagged_release_is_not_a_draft
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REF_NAME: ${{ github.ref_name }}
run: |
gh release edit "$GITHUB_REF_NAME" --draft=false -R d1vanov/QEverCloudGenerator