-
-
Notifications
You must be signed in to change notification settings - Fork 398
1008 lines (917 loc) · 42.5 KB
/
release-nightly.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
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI/CT/CD test and nightly release
# env:
# name: staging_environment
# concurrency: staging_environment
on:
schedule:
- cron: "50 10 * * *"
pull_request:
push:
paths:
- "**.js"
- "!**/release-nightly.yml"
- "!patches/**"
- "!public/**"
- "!wix/**"
- "!snapcraft/**"
- "!developer/**"
- "!build-scripts/**"
- "!test/**"
- "dist/**"
- "release.json"
branches: [main]
jobs:
nightly_job:
runs-on: ${{ matrix.os }}
if: |
!contains(github.event.head_commit.message , 'skip workflow') && !contains(github.event.head_commit.message , 'Merge branch')
outputs:
tag-name: ${{ steps.unify.outputs.tag-name }}
release-name: ${{ steps.unify.outputs.release-name }}
package-name: ${{ steps.unify.outputs.package-name }}
isRunAppium: ${{ steps.check.outputs.isRunAppium }}
isBuildUniversal: ${{ steps.check.outputs.isBuildUniversal }}
isModifyReleaseJson: ${{ steps.unify.outputs.isModifyReleaseJson }}
repository: ${{ steps.check.outputs.repository }}
display-name: ${{ steps.slug.outputs.display-name }}
file-name-lower: ${{ steps.slug.outputs.file-name-lower }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16]
include:
- os: macos-latest
node-version: 18
- os: windows-latest
node-version: 16
fail-fast: false
environment:
name: CICD
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT }}
GITHUB_PAT: ${{ secrets.PAT }}
CERT_DATA: ${{ secrets.APPLE_CERT_DATA }}
CERT_PASS: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ASP: ${{ secrets.APPLE_ASP }}
GOOGLE_EMAIL_USERNAME: ${{ secrets.GOOGLE_EMAIL_USERNAME }}
GOOGLE_EMAIL_PASSWORD: ${{ secrets.GOOGLE_EMAIL_PASSWORD }}
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
PHONE_NUMBER_ACCOUNT: ${{ secrets.PHONE_NUMBER_ACCOUNT }}
PHONE_NUMBER_TOKEN: ${{ secrets.PHONE_NUMBER_TOKEN }}
TEST_EMAIL_DOMAIN: ${{ secrets.TEST_EMAIL_DOMAIN }}
TEST1_EMAIL: ${{ secrets.TEST1_EMAIL }}
TEST2_EMAIL: ${{ secrets.TEST2_EMAIL }}
TEST3_EMAIL: ${{ secrets.TEST3_EMAIL }}
TEST1_PHONE_NUMBER: ${{ secrets.TEST1_PHONE_NUMBER }}
TEST2_PHONE_NUMBER: ${{ secrets.TEST2_PHONE_NUMBER }}
TEST3_PHONE_NUMBER: ${{ secrets.TEST3_PHONE_NUMBER }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
TEST_RESET_PASSWORD: ${{ secrets.TEST_RESET_PASSWORD }}
OAUTH_ACCOUNT_PASSWORD: ${{ secrets.OAUTH_ACCOUNT_PASSWORD }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
steps:
- name: Get short SHA 🔑
id: sha
run: |
echo "sha7=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout ${{ steps.sha.outputs.sha7 }} ⬇️
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- name: Get app name
id: slug
run: |
DISPLAYNAME=$(cat developer/app.js | perl -wnE"say for /(?<=displayName\:\s)\'?.*\'?(?=,)/gm")
APPNAME=$(cat developer/app.js | perl -wnE"say for /(?<=const\sAPP\s=\s\')[a-zA-Z]+/gm")
FILENAME=$(cat developer/app.js | perl -wnE"say for /(?<=fileName\:\s)\'?.*\'?(?=,)/gm")
echo ${APPNAME}
echo ${DISPLAYNAME}
echo ${FILENAME}
echo "app-name=${APPNAME}" >> $GITHUB_OUTPUT
echo "app-name-lower=$(echo ${APPNAME} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
if [[ ${DISPLAYNAME} = "APP" ]] ; \
then echo "display-name=${APPNAME}" >> $GITHUB_OUTPUT ; \
echo "display-name-lower=$(echo ${APPNAME} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT ; \
else DISPLAYNAME=$(echo ${DISPLAYNAME} | sed "s/'//g") ; \
echo "display-name=${DISPLAYNAME}" >> $GITHUB_OUTPUT ; \
echo "display-name-lower=$(echo ${DISPLAYNAME} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT ; \
fi
if [[ ${FILENAME} = "APP" ]] ; \
then echo "file-name=${APPNAME}" >> $GITHUB_OUTPUT ; \
echo "file-name-lower=$(echo ${APPNAME} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT ; \
else FILENAME=$(echo ${FILENAME} | sed "s/'//g") ; \
echo "file-name=${FILENAME}" >> $GITHUB_OUTPUT ; \
echo "file-name-lower=$(echo ${FILENAME} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT ; \
fi
shell: bash
- name: Setup Node.js ${{ matrix.node-version }} 📮
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
registry-url: "https://npm.pkg.github.com"
scope: "@zeeis"
- name: Get message
id: vars
run: |
echo "date=$(TZ=UTC-8 git log -1 --date=format-local:"%Y%m%d%H%M" --format="%cd")" >> $GITHUB_OUTPUT
echo "event-name=${{ github.event_name }}" >> $GITHUB_OUTPUT
echo "download-tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
if [[ ${{ matrix.os }} = "ubuntu-latest" ]] ; \
then echo "system=ubuntu" >> $GITHUB_OUTPUT ; \
echo "package=${{ steps.slug.outputs.display-name }}-linux-x64" >> $GITHUB_OUTPUT ; \
elif [[ ${{ matrix.os }} = "macos-latest" ]] ; \
then echo "system=macos" >> $GITHUB_OUTPUT ; \
echo "package=${{ steps.slug.outputs.display-name }}-darwin-x64" >> $GITHUB_OUTPUT ; \
elif [[ ${{ matrix.os }} = "windows-latest" ]] ; \
then echo "system=windows" >> $GITHUB_OUTPUT ; \
echo "package=${{ steps.slug.outputs.display-name }}-win32-x64" >> $GITHUB_OUTPUT ; \
fi
export COMMIT_HEAD=$(git log -1 --pretty=%B | perl -wnE'say for /^\w+/gm')
if [[ "$COMMIT_HEAD" = "Merge" ]] ; \
then export MODIFIED_FILE_LIST=$(git show --pretty="format:" --name-only -2) ; \
else export MODIFIED_FILE_LIST=$(git show --pretty="format:" --name-only) ; \
fi
MODIFIED_FILE_LIST=$(echo $MODIFIED_FILE_LIST | tr '\n' ' ')
echo "MODIFIED_FILE_LIST=$MODIFIED_FILE_LIST" >> "$GITHUB_ENV"
# EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
# echo "MODIFIED_FILE_LIST<<$EOF" >> "$GITHUB_ENV"
# echo "$MODIFIED_FILE_LIST" >> "$GITHUB_ENV"
# echo "$EOF" >> "$GITHUB_ENV"
shell: bash
- name: Get release.json property
id: release
if: contains(env.MODIFIED_FILE_LIST, 'release.json')
run: |
CONTENT=$(cat ./release.json)
TARGET_TAG_NAME=$(echo "$CONTENT" | perl -wnE"say for /(?<=targetTagName\"\:\s\").*(?=\",)/gm")
NEW_TAG_NAME=$(echo "$CONTENT" | perl -wnE"say for /(?<=newTagName\"\:\s\").*(?=\")/gm")
echo "target-tag-name=${TARGET_TAG_NAME}"
echo "new-tag-name=${NEW_TAG_NAME}"
echo "target-tag-name=${TARGET_TAG_NAME}" >> $GITHUB_OUTPUT
echo "new-tag-name=${NEW_TAG_NAME}" >> $GITHUB_OUTPUT
shell: bash
- name: Get package.json version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: "package.json"
prop_path: "version"
- name: Checkout release.json target tag
id: checkout
if: contains(env.MODIFIED_FILE_LIST, 'release.json')
run: |
git checkout ${{ steps.release.outputs.target-tag-name }}
git show --name-only
shell: bash
- name: Get unpackaged/version.json property
id: unpackaged
run: |
CONTENT=$(cat ./dist/electron/UnPackaged/version.json)
PACKAGE_VERSION=$(echo "$CONTENT" | perl -wnE"say for /(?<=packageVer\"\:\s\").*(?=\")/gm")
echo "package-version=${PACKAGE_VERSION}"
echo "package-version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
shell: bash
# stable version x.y.z+1
- name: Get UnstableVersion
id: unstable
run: |
echo "unstable-version=$(echo ${{ steps.unpackaged.outputs.package-version }} | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')" >> $GITHUB_OUTPUT
shell: bash
# after git checkout
- name: Get last commit date \ today all commit message
if: contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json')
id: nightly
run: |
echo "commit-sha7=$(git log -1 --pretty=%B --author="Alphabiz-Team" | perl -wnE'say for /(?<=-)\w{7,8}(?=\s)|^\w{7,8}(?=\s)/g')" >> $GITHUB_OUTPUT
export DESCRIBE=$(cat github-describe/github-describe.txt)
echo "$DESCRIBE"
DESCRIBE=$(head -n 1 github-describe/github-describe.txt)
echo "DESCRIBE=$DESCRIBE" >> "$GITHUB_ENV"
# echo "DESCRIBE<<EOF" >> "$GITHUB_ENV"
# echo "$DESCRIBE" >> "$GITHUB_ENV"
# echo "EOF" >> "$GITHUB_ENV"
shell: bash
# This step for unify the tag name
# nightly-release use tag_name: $packageJsonVersion-internal/nightly-$dateTime-$commitId
# official-release use tag_name: ./release.json property newTagName
- name: Unified Tag format
if: contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json')
id: unify
run: |
if ${{ contains(env.MODIFIED_FILE_LIST, 'release.json') }} ; \
then echo "tag-name=${{ steps.release.outputs.new-tag-name }}" >> $GITHUB_OUTPUT ; \
echo "isModifyReleaseJson=1" >> $GITHUB_OUTPUT ; \
if ${{ contains(steps.release.outputs.new-tag-name, 'nightly') }} ; \
then echo "release-name=${{ steps.release.outputs.new-tag-name }}-${{ steps.nightly.outputs.commit-sha7 }}" >> $GITHUB_OUTPUT ; \
else echo "release-name=${{ steps.release.outputs.new-tag-name }}-${{ steps.nightly.outputs.commit-sha7 }}" >> $GITHUB_OUTPUT ; \
fi
echo "package-name=${{ steps.release.outputs.new-tag-name }}" >> $GITHUB_OUTPUT ; \
else echo "tag-name=${{ steps.unstable.outputs.unstable-version }}-nightly-${{ steps.vars.outputs.date }}" >> $GITHUB_OUTPUT ; \
echo "release-name=${{ steps.unstable.outputs.unstable-version }}-nightly-${{ steps.vars.outputs.date }}-${{ steps.nightly.outputs.commit-sha7 }}" >> $GITHUB_OUTPUT ; \
echo "package-name=${{ steps.unstable.outputs.unstable-version }}-nightly-${{ steps.vars.outputs.date }}" >> $GITHUB_OUTPUT ; \
echo "isModifyReleaseJson=0" >> $GITHUB_OUTPUT ; \
fi
shell: bash
# this step checkout all output
- name: Checkout vars-date ${{ steps.vars.outputs.date }} ⬇️
id: check
run: |
echo "isBuildUniversal=0" >> $GITHUB_OUTPUT
echo "repo-name: ${{ github.repository }}"
echo "repository=${{ github.repository }}" >> $GITHUB_OUTPUT
echo "slug----------------------"
echo "app-name: ${{ steps.slug.outputs.app-name }}"
echo "app-name-lower: ${{ steps.slug.outputs.app-name-lower }}"
echo "display-name: ${{ steps.slug.outputs.display-name }}"
echo "display-name-lower: ${{ steps.slug.outputs.display-name-lower }}"
echo "file-name: ${{ steps.slug.outputs.file-name }}"
echo "file-name-lower: ${{ steps.slug.outputs.file-name-lower }}"
echo "vars----------------------"
echo "run workflow date: ${{ steps.vars.outputs.date }}"
echo "event_name: ${{ steps.vars.outputs.event-name }}"
echo "download-tag: ${{ steps.vars.outputs.download-tag }}"
echo "event.head_commit.message: ${{ github.event.head_commit.message }}"
echo "system: ${{ steps.vars.outputs.system }}"
echo "package: ${{ steps.vars.outputs.package }}"
echo "release----------------------"
echo "target-tag-name: ${{ steps.release.outputs.target-tag-name }}"
echo "new-tag-name: ${{ steps.release.outputs.new-tag-name }}"
echo "version----------------------"
echo "package.json version: ${{ steps.version.outputs.prop }}"
echo "unpackaged----------------------"
echo "unpackage.version: ${{ steps.unpackaged.outputs.package-version }}"
echo "unstable----------------------"
echo "unstable-version: ${{ steps.unstable.outputs.unstable-version }}"
echo "----------------------"
echo "MODIFIED_FILE_LIST: ${{ env.MODIFIED_FILE_LIST }}"
if ${{ contains(env.MODIFIED_FILE_LIST, 'release.json') }} ; \
then echo "isRunAppium=1" >> $GITHUB_OUTPUT ; \
else echo "isRunAppium=0" >> $GITHUB_OUTPUT ; \
fi
echo "unify----------------------"
echo "tag-name: ${{ steps.unify.outputs.tag-name }}"
echo "release-name: ${{ steps.unify.outputs.release-name }}"
echo "package-name: ${{ steps.unify.outputs.package-name }}"
echo "nightly----------------------"
echo "commit-sha7: ${{ steps.nightly.outputs.commit-sha7 }}"
shell: bash
- name: install setuptools (mac)
if: runner.os == 'macOS'
run: |
pip install setuptools
- name: Install dependencies 👨🏻💻
uses: nick-fields/retry@v2
with:
timeout_seconds: 600
max_attempts: 2
shell: bash
retry_on: error
command: yarn
on_retry_command: rm -rf C:/Users/runneradmin/AppData/Local/node-gyp/
- name: Install UnPackaged 👨🏻💻
uses: nick-fields/retry@v2
with:
timeout_seconds: 600
max_attempts: 2
shell: bash
retry_on: error
command: yarn unpackaged
on_retry_command: rm -rf C:/Users/runneradmin/AppData/Local/node-gyp/
# - name: setDisplay for windows
# if: contains(steps.vars.outputs.system, 'windows')
# run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
# shell: powershell
- name: screen resolution(For Win)
if: runner.os == 'Windows'
run: |
Set-DisplayResolution -Width 1920 -Height 1080 -Force
shell: powershell
- name: screen resolution(For Mac)
if: runner.os == 'macOS'
run: |
system_profiler SPDisplaysDataType | grep Resolution
"/Library/Application Support/VMware Tools/vmware-resolutionSet" 2560 1440
system_profiler SPDisplaysDataType | grep Resolution
- name: main E2E Test for Electron 🧪
if: "!contains(github.event.head_commit.message, 'skip e2e')"
run: |
export REPO=alphabiz
yarn test:e2e:electron:main
unset REPO
shell: bash
- name: wallet E2E Test for Electron 🧪
if: "!contains(github.event.head_commit.message, 'skip e2e')"
run: |
export REPO=alphabiz
yarn test:e2e:electron:wallet
unset REPO
shell: bash
- name: E2E Test 🧪
if: |
!contains(github.event.head_commit.message, 'skip e2e') && !contains(steps.vars.outputs.system, 'windows')
&& github.repository == 'tanshuai/alphabiz'
run: yarn test:e2e:ci
- name: Upload Test Results 🗃
if: always()
uses: actions/upload-artifact@v3
with:
name: "${{ matrix.os }}-output"
path: test/output/**
#后面的step晚上运行 或 正式发布
- name: Get recommends from github
if: |
(contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json'))
&& steps.slug.outputs.app-name == 'Alphabiz'
run: |
curl -H 'Authorization: token ${{ secrets.PAT }}' \
-L "https://raw.githubusercontent.com/tanshuai/alpha.biz/main/static/recommends/v0.2.1.txt" \
> public/recommends.txt
shell: bash
- name: Run electron-packager 📦
if: contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json')
run: |
if ${{ contains(env.MODIFIED_FILE_LIST, 'release.json') }} ; \
then if ${{ contains(steps.release.outputs.new-tag-name, 'nightly') }} ; \
then yarn node update-version.js --newTag ${{ steps.unify.outputs.tag-name }} --SHA7 ${{ steps.sha.outputs.sha7 }} --buildTime ${{ steps.vars.outputs.date }} ; \
else yarn node update-version.js --newTag ${{ steps.unify.outputs.tag-name }} --SHA7 ${{ steps.sha.outputs.sha7 }} --buildTime ${{ steps.vars.outputs.date }} --stable; \
fi
else yarn node update-version.js --buildTime ${{ steps.vars.outputs.date }} ; \
fi
yarn packager
shell: bash
- name: Setup coreutils
if: |
(contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json'))
&& contains(steps.vars.outputs.system, 'macos')
&& env.CERT_PASS != ''
run: brew install coreutils
- name: Import cert
if: |
(contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json'))
&& contains(steps.vars.outputs.system, 'macos')
&& env.CERT_PASS != ''
env:
CERT_DATA: ${{ secrets.APPLE_CERT_DATA }}
CERT_PASS: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
# Export certs
echo "$CERT_DATA" | base64 --decode > /tmp/certs.p12
echo "exported certs.p12 to /tmp/certs.p12"
# Create keychain
security create-keychain -p actions macos-build.keychain
security default-keychain -s macos-build.keychain
security unlock-keychain -p actions macos-build.keychain
security set-keychain-settings -t 3600 -u macos-build.keychain
# Import certs to keychain
security import /tmp/certs.p12 -k ~/Library/Keychains/macos-build.keychain -P "$CERT_PASS" -T /usr/bin/codesign -T /usr/bin/productsign
echo "imported certs"
# Key signing
security set-key-partition-list -S apple-tool:,apple: -s -k actions macos-build.keychain
# Verify keychain things
echo "Verifying keychain..."
security find-identity -v macos-build.keychain | grep "$APPLE_TEAM_ID" | grep "Developer ID Application"
security find-identity -v macos-build.keychain | grep "$APPLE_TEAM_ID" | grep "Developer ID Installer"
echo "Keychain verified"
- name: Pack app 📦
if: contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json')
run: |
if [[ ${{ steps.vars.outputs.system }} == *macos* ]] && [[ -n "${{ env.APPLE_ID }}" ]]; then
export PLATFORM=darwin
export BUILD_PLATFORM=darwin
export ARCH=x64
export BUILD_ARCH=x64
export APP_BUNDLE_ID=org.alpha.biz
export CERT_PASS="${{ secrets.APPLE_CERT_PASSWORD }}"
export APPLE_TEAM_ID="${{ secrets.APPLE_TEAM_ID }}"
export APPLE_DISTRIBUTION_KEY="Developer ID Application"
export VERSION="${{ steps.unify.outputs.tag-name }}"
export BUILD_VERSION="${{ steps.unify.outputs.tag-name }}"
export APP="${{ steps.slug.outputs.display-name }}"
export APPLE_ID="${{ secrets.APPLE_ID }}"
export APPLE_ASP="${{ secrets.APPLE_ASP }}"
fi
export PATH=$PATH:/c/Program\ Files\ \(x86\)/WiX\ Toolset\ v3.11/bin
yarn make
if [[ ${{ steps.vars.outputs.system }} == *macos* ]] && [[ -n "${{ env.APPLE_ID }}" ]]; then
SIGN_APP="./out/$APP-$PLATFORM-$ARCH/$APP.app"
echo "$SIGN_APP"
echo "$APP"
# Throw error if file does not exist
if [ ! -e "$SIGN_APP" ]; then
echo "$SIGN_APP does not exist!"
exit 5
fi
# ./build-scripts/macos/pkg/sign.sh
# Verify the code signature
echo "Verifying..."
codesign -v -vvv "$SIGN_APP"
pkgutil --check-signature "$SIGN_APP"
echo "Signature verified."
fi
shell: bash
- name: Create And Sign Pkg
if: |
(contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json'))
&& contains(steps.vars.outputs.system, 'macos')
&& env.CERT_PASS != ''
continue-on-error: true # If sign failed, just continue for normal builds
env:
CERT_DATA: ${{ secrets.APPLE_CERT_DATA }}
CERT_PASS: ${{ secrets.APPLE_CERT_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_DISTRIBUTION_KEY: "Developer ID Application"
APPLE_INSTALLER_KEY: "Developer ID Installer"
VERSION: ${{ steps.unify.outputs.tag-name }}
BUILD_VERSION: ${{ steps.unify.outputs.tag-name }}
PLATFORM: darwin
BUILD_PLATFORM: darwin
ARCH: x64
BUILD_ARCH: x64
APP: "${{ steps.slug.outputs.display-name }}"
APP_BUNDLE_ID: org.alpha.biz
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ASP: ${{ secrets.APPLE_ASP }}
run: |
SIGN_FILE="out/installers/${{ env.VERSION }}/${{ env.APP }}_${{ env.PLATFORM }}_${{ env.VERSION }}.pkg"
UNSIGNED_FILE="out/installers/${{ env.VERSION }}/${{ env.APP }}_${{ env.PLATFORM }}_${{ env.VERSION }}_unsigned.pkg"
echo "Build pkg"
./build-scripts/macos/pkg/build.sh
echo "Check pkg size"
du -h "$SIGN_FILE"
echo "Remove unsigned pkg"
if [ -e "$UNSIGNED_FILE" ]; then
rm "$UNSIGNED_FILE"
fi
echo "Notarizing dmg..."
SIGNED_DMG="out/installers/$VERSION/${{ steps.slug.outputs.app-name-lower }}-$ARCH-$VERSION.dmg"
xcrun notarytool submit "$SIGNED_DMG" -v --apple-id "$APPLE_ID" --password "$APPLE_ASP" --team-id "$APPLE_TEAM_ID" -f json --wait
xcrun stapler staple "$SIGNED_DMG"
echo "Finish notarizing dmg"
- name: Package for ${{ steps.vars.outputs.system }}-${{ steps.unify.outputs.tag-name }} Release 🗜️
if: contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json')
run: 7z a -t7z -mx=9 "./out/installers/${{ steps.unify.outputs.tag-name }}/${{ steps.slug.outputs.file-name-lower }}-${{ steps.unify.outputs.package-name }}-${{ steps.vars.outputs.system }}.7z" "./dist/electron/${{ steps.vars.outputs.package }}"
- name: Generate shasum files
run: node build-scripts/common/shasum.js out/installers/${{ steps.unify.outputs.tag-name }}
shell: bash
continue-on-error: true # Missing .sha files is still ok
- name: Release ${{ steps.slug.outputs.file-name-lower }}-${{ steps.unify.outputs.package-name }}-${{ steps.vars.outputs.system }} to GitHub 📰
if: |
(contains(steps.vars.outputs.event-name, 'schedule') || contains(env.MODIFIED_FILE_LIST, 'release.json')) &&
(matrix.os != 'macos-latest' || contains(steps.check.outputs.isBuildUniversal, '0'))
uses: softprops/action-gh-release@v1
with:
prerelease: true
name: ${{ steps.slug.outputs.file-name-lower }}-${{ steps.unify.outputs.release-name }}
tag_name: ${{ steps.unify.outputs.tag-name }}
body: ${{ env.DESCRIBE }}
files: |
./out/installers/${{ steps.unify.outputs.tag-name }}/**
- name: public describe to Twitter
if: |
contains(steps.vars.outputs.event-name, 'schedule') && matrix.os == 'ubuntu-latest'
&& steps.slug.outputs.app-name == 'Alphabiz'
run: yarn node publicTwitter.js
strat_instances_job:
needs: nightly_job
runs-on: ${{ matrix.os }}
if: |
(contains(github.event_name, 'schedule') || contains(needs.nightly_job.outputs.isModifyReleaseJson, '1')) &&
contains(needs.nightly_job.outputs.isBuildUniversal, '1')
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16]
fail-fast: false
environment:
name: CICD
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT }}
GITHUB_PAT: ${{ secrets.PAT }}
AWS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Get short SHA 🔑
id: sha
run: |
echo "sha7=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout ${{ steps.sha.outputs.sha7 }} ⬇️
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- name: Setup Node.js ${{ matrix.node-version }} 📮
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
registry-url: "https://npm.pkg.github.com"
scope: "@zeeis"
- name: Install dependencies 👨🏻💻
uses: nick-fields/retry@v2
with:
timeout_seconds: 600
max_attempts: 2
shell: bash
retry_on: error
command: yarn
on_retry_command: rm -rf C:/Users/runneradmin/AppData/Local/node-gyp/
# - name: start EC2 Instances
# run: yarn node ./test/scripts/EC2.js --allocate
# shell: bash
release_dmg_job:
needs: [nightly_job, strat_instances_job]
if: |
(contains(github.event_name, 'schedule') || contains(needs.nightly_job.outputs.isModifyReleaseJson, '1')) &&
contains(needs.nightly_job.outputs.isBuildUniversal, '1')
timeout-minutes: 120
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16]
os: [macos-m1-runner]
environment:
name: CICD
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT }}
GITHUB_PAT: ${{ secrets.PAT }}
steps:
- name: Get short SHA 🔑
id: sha
run: |
echo "sha7=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout ${{ steps.sha.outputs.sha7 }} ⬇️
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- name: Get message
id: vars
run: |
echo "system=macos" >> $GITHUB_OUTPUT
echo "date=$(TZ=UTC-8 git log -1 --date=format-local:"%Y%m%d%H%M" --format="%cd")" >> $GITHUB_OUTPUT
- name: Get release.json property
id: release
if: contains(needs.nightly_job.outputs.isModifyReleaseJson, '1')
run: |
CONTENT=$(cat ./release.json)
TARGET_TAG_NAME=$(echo "$CONTENT" | perl -wnE"say for /(?<=targetTagName\"\:\s\").*(?=\",)/gm")
NEW_TAG_NAME=$(echo "$CONTENT" | perl -wnE"say for /(?<=newTagName\"\:\s\").*(?=\")/gm")
echo "target-tag-name=${TARGET_TAG_NAME}"
echo "new-tag-name=${NEW_TAG_NAME}"
echo "target-tag-name=${TARGET_TAG_NAME}" >> $GITHUB_OUTPUT
echo "new-tag-name=${NEW_TAG_NAME}" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout release.json target tag
id: checkout
if: contains(needs.nightly_job.outputs.isModifyReleaseJson, '1')
run: |
git checkout ${{ steps.release.outputs.target-tag-name }}
git show --name-only
shell: bash
- name: Install dependencies 👨🏻💻
uses: nick-fields/retry@v2
with:
timeout_seconds: 600
max_attempts: 2
shell: bash
retry_on: error
command: yarn
on_retry_command: rm -rf C:/Users/runneradmin/AppData/Local/node-gyp/
- name: Prepare packing env
run: |
if ${{ contains(needs.nightly_job.outputs.isModifyReleaseJson, '1') }} ; \
then if ${{ contains(steps.release.outputs.new-tag-name, 'nightly') }} ; \
then yarn node update-version.js --newTag ${{needs.nightly_job.outputs.tag-name}} --SHA7 ${{ steps.sha.outputs.sha7 }} --buildTime ${{ steps.vars.outputs.date }} ; \
else yarn node update-version.js --newTag ${{needs.nightly_job.outputs.tag-name}} --SHA7 ${{ steps.sha.outputs.sha7 }} --buildTime ${{ steps.vars.outputs.date }} --stable; \
fi
else yarn node update-version.js --buildTime ${{ steps.vars.outputs.date }} ; \
fi
node ./build-scripts/macos/get-env.js --darwin
cp ./build-scripts/macos/.env ./.env
shell: bash
- name: Pack app 📦
run: |
./build-scripts/macos/app/build.sh
- name: Pack dmg 📦
run: |
./build-scripts/macos/dmg/build.sh
- name: Pack 7z 📦
run: |
7z a -t7z -mx=9 "./out/installers/${{needs.nightly_job.outputs.tag-name}}/${{ needs.nightly_job.outputs.file-name-lower }}-arm64-${{needs.nightly_job.outputs.tag-name}}-macos.7z" "./dist/electron/${{ needs.nightly_job.outputs.display-name }}-darwin-arm64"
7z a -t7z -mx=9 "./out/installers/${{needs.nightly_job.outputs.tag-name}}/${{ needs.nightly_job.outputs.file-name-lower }}-x64-${{needs.nightly_job.outputs.tag-name}}-macos.7z" "./dist/electron/${{ needs.nightly_job.outputs.display-name }}-darwin-x64"
7z a -t7z -mx=9 "./out/installers/${{needs.nightly_job.outputs.tag-name}}/${{ needs.nightly_job.outputs.file-name-lower }}-universal-${{needs.nightly_job.outputs.tag-name}}-macos.7z" "./dist/electron/${{ needs.nightly_job.outputs.display-name }}-darwin-universal"
- name: Generate shasum files
run: node build-scripts/common/shasum.js out/installers/${{needs.nightly_job.outputs.tag-name}}
shell: bash
continue-on-error: true # Missing .sha files is still ok
- name: Release macos dmg to GitHub 📰
uses: softprops/action-gh-release@v1
with:
prerelease: true
name: ${{ needs.nightly_job.outputs.file-name-lower }}-${{ needs.nightly_job.outputs.release-name }}
tag_name: ${{needs.nightly_job.outputs.tag-name}}
files: |
./out/installers/${{ needs.nightly_job.outputs.tag-name }}/**
- name: Upload Test Results 🗃
if: always()
uses: actions/upload-artifact@v3
with:
name: "build-dmg-output"
path: build.log
release_snapcraft_job:
needs: [nightly_job]
runs-on: ${{ matrix.os }}
if: contains(github.event_name, 'schedule') || contains(needs.nightly_job.outputs.isModifyReleaseJson, '1')
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [16]
fail-fast: false
environment:
name: CICD
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT }}
GITHUB_PAT: ${{ secrets.PAT }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
steps:
- name: Get short SHA 🔑
id: sha
run: |
echo "sha7=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout ${{ steps.sha.outputs.sha7 }} ⬇️
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- name: Setup Node.js ${{ matrix.node-version }} 📮
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
registry-url: "https://npm.pkg.github.com"
scope: "@zeeis"
- name: Get message
id: vars
run: |
echo "date=$(TZ=UTC-8 git log -1 --date=format-local:"%Y%m%d%H%M" --format="%cd")" >> $GITHUB_OUTPUT
if [[ ${{ matrix.os }} = "ubuntu-latest" ]] ; \
then echo "system=ubuntu" >> $GITHUB_OUTPUT ; \
echo "package=${{ steps.slug.outputs.display-name }}-linux-x64" >> $GITHUB_OUTPUT ; \
elif [[ ${{ matrix.os }} = "macos-latest" ]] ; \
then echo "system=macos" >> $GITHUB_OUTPUT ; \
echo "package=${{ steps.slug.outputs.display-name }}-darwin-x64" >> $GITHUB_OUTPUT ; \
elif [[ ${{ matrix.os }} = "windows-latest" ]] ; \
then echo "system=windows" >> $GITHUB_OUTPUT ; \
echo "package=${{ steps.slug.outputs.display-name }}-win32-x64" >> $GITHUB_OUTPUT ; \
fi
shell: bash
- name: Get release.json property
id: release
if: contains(needs.nightly_job.outputs.isModifyReleaseJson, '1')
run: |
CONTENT=$(cat ./release.json)
TARGET_TAG_NAME=$(echo "$CONTENT" | perl -wnE"say for /(?<=targetTagName\"\:\s\").*(?=\",)/gm")
NEW_TAG_NAME=$(echo "$CONTENT" | perl -wnE"say for /(?<=newTagName\"\:\s\").*(?=\")/gm")
echo "target-tag-name=${TARGET_TAG_NAME}"
echo "new-tag-name=${NEW_TAG_NAME}"
echo "target-tag-name=${TARGET_TAG_NAME}" >> $GITHUB_OUTPUT
echo "new-tag-name=${NEW_TAG_NAME}" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout release.json target tag
id: checkout
if: contains(needs.nightly_job.outputs.isModifyReleaseJson, '1')
run: |
git checkout ${{ steps.release.outputs.target-tag-name }}
git show --name-only
shell: bash
- name: Install dependencies 👨🏻💻
uses: nick-fields/retry@v2
with:
timeout_seconds: 600
max_attempts: 2
shell: bash
retry_on: error
command: yarn
on_retry_command: rm -rf C:/Users/runneradmin/AppData/Local/node-gyp/
- name: Install UnPackaged 👨🏻💻
uses: nick-fields/retry@v2
with:
timeout_seconds: 600
max_attempts: 2
shell: bash
retry_on: error
command: yarn unpackaged
on_retry_command: rm -rf C:/Users/runneradmin/AppData/Local/node-gyp/
- name: Run electron-packager
run: |
if ${{ contains(needs.nightly_job.outputs.isModifyReleaseJson, '1') }} ; \
then if ${{ contains(steps.release.outputs.new-tag-name, 'nightly') }} ; \
then yarn node update-version.js --newTag ${{needs.nightly_job.outputs.tag-name}} --SHA7 ${{ steps.sha.outputs.sha7 }} --buildTime ${{ steps.vars.outputs.date }} ; \
else yarn node update-version.js --newTag ${{needs.nightly_job.outputs.tag-name}} --SHA7 ${{ steps.sha.outputs.sha7 }} --buildTime ${{ steps.vars.outputs.date }} --stable; \
fi
else yarn node update-version.js --buildTime ${{ steps.vars.outputs.date }} ; \
fi
yarn packager
shell: bash
# fix lxd dir error in ubuntu20.04
- name: fix lxd dir error
run: |
sudo ln -s /var/snap/lxd/common/lxd /var/lib/lxd
sudo snap install multipass --classic
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
with:
use_lxd: true
- name: Pack snap 📦
run: yarn make:snap:ci
- name: Generate shasum files
run: node build-scripts/common/shasum.js out/installers/${{ needs.nightly_job.outputs.tag-name }}
shell: bash
continue-on-error: true # Missing .sha files is still ok
- name: Release ${{ needs.nightly_job.outputs.file-name-lower }}-${{ needs.nightly_job.outputs.package-name }}-${{ steps.vars.outputs.system }} to GitHub 📰
uses: softprops/action-gh-release@v1
with:
prerelease: true
name: ${{ needs.nightly_job.outputs.file-name-lower }}-${{ needs.nightly_job.outputs.release-name }}
tag_name: ${{needs.nightly_job.outputs.tag-name}}
body: ${{ env.DESCRIBE }}
files: |
./out/installers/${{ needs.nightly_job.outputs.tag-name }}/**
# Generate snap token
# snapcraft export-login --snaps [SNAP_NAME] --channels edge -
- name: Upload snap to SnapCraft 📰
if: env.SNAPCRAFT_STORE_CREDENTIALS != ''
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: |
snapcraft upload --release=edge ./out/installers/${{ needs.nightly_job.outputs.tag-name }}/*.snap
appium_test_job:
needs: [nightly_job, release_snapcraft_job]
if: |
contains(github.event_name, 'schedule') || contains(needs.nightly_job.outputs.isRunAppium, '1')
timeout-minutes: 120
runs-on: ${{ matrix.os }}
strategy:
matrix:
test: [1, 2]
node-version: [16]
os: [windows-latest]
include:
- test: 1
os: windows-latest
- test: 2
os: windows-latest
environment:
name: CICD
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT }}
GITHUB_PAT: ${{ secrets.PAT }}
EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
PHONE_NUMBER_ACCOUNT: ${{ secrets.PHONE_NUMBER_ACCOUNT }}
PHONE_NUMBER_TOKEN: ${{ secrets.PHONE_NUMBER_TOKEN }}
TEST1_EMAIL: ${{ secrets.TEST1_EMAIL }}
TEST2_EMAIL: ${{ secrets.TEST2_EMAIL }}
TEST3_EMAIL: ${{ secrets.TEST3_EMAIL }}
TEST_EMAIL_DOMAIN: ${{ secrets.TEST_EMAIL_DOMAIN }}
TEST1_PHONE_NUMBER: ${{ secrets.TEST1_PHONE_NUMBER }}
TEST2_PHONE_NUMBER: ${{ secrets.TEST2_PHONE_NUMBER }}
TEST3_PHONE_NUMBER: ${{ secrets.TEST3_PHONE_NUMBER }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
TEST_RESET_PASSWORD: ${{ secrets.TEST_RESET_PASSWORD }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
steps:
- name: appium_test_job Get short SHA 🔑
run: |
echo "sha7=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
echo "nightly_job"
echo "isRunAppium: ${{needs.nightly_job.outputs.isRunAppium}}"
echo "repository: ${{needs.nightly_job.outputs.repository}}"
shell: bash
- name: Checkout ⬇️
uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node-version }} 📮
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
registry-url: "https://npm.pkg.github.com"
scope: "@zeeis"
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT }}
- name: Get message
run: |
git fetch --prune --unshallow
shell: bash
- name: Install dependencies 👨🏻💻
uses: nick-fields/retry@v2
with:
timeout_seconds: 600
max_attempts: 2
shell: bash
retry_on: error
command: yarn
- name: Install ${{ needs.nightly_job.outputs.file-name-lower }}.7z
run: |
curl -L https://github.com/${{ needs.nightly_job.outputs.repository }}/releases/download/${{needs.nightly_job.outputs.tag-name}}/${{ needs.nightly_job.outputs.file-name-lower }}-${{needs.nightly_job.outputs.tag-name}}-windows.7z > appPackage.7z
7z x appPackage.7z
shell: bash
- name: Install winappdriver.msi
run: |
Set-DisplayResolution -Width 1920 -Height 1080 -Force
Invoke-WebRequest "https://github.com/microsoft/WinAppDriver/releases/download/v1.2.1/WindowsApplicationDriver_1.2.1.msi" -OutFIle "C:\WindowsApplicationDriver_1.2.1.msi"
Start-Process msiexec -ArgumentList "/quiet","/x","{087BBF93-D9E3-4D27-BDBE-9C702E0066FC}" -Verb runAs -Wait
Start-Process msiexec -ArgumentList "/quiet","/i","C:\WindowsApplicationDriver_1.2.1.msi" -Verb runAs -Wait
Start-Sleep -s 5
shell: powershell
- name: Run appium
run: |
$env:JEST_TEST = 'true'
Start-Process PowerShell -ArgumentList "yarn test:appium"
Start-Sleep -s 10
- name: E2E appium creditDownload test for 7z 🧪
if: matrix.test == '1'
uses: nick-fields/retry@v2
with:
timeout_seconds: 6000
max_attempts: 3
shell: bash
retry_on: error
command: |
taskkill //F //IM "${{ needs.nightly_job.outputs.display-name }}.exe" || (echo "app is ready")
sleep 10s
yarn test:release:creditsDownload
- name: E2E appium creditUpload test for 7z 🧪
if: matrix.test == '2'
uses: nick-fields/retry@v2
with:
timeout_seconds: 6000
max_attempts: 3
shell: bash
retry_on: error
command: |
taskkill //F //IM "${{ needs.nightly_job.outputs.display-name }}.exe" || (echo "app is ready")
sleep 10s
yarn test:release:creditsUpload
- name: Download msi and exe
run: |
curl -L https://github.com/${{ needs.nightly_job.outputs.repository }}/releases/download/${{needs.nightly_job.outputs.tag-name}}/${{ needs.nightly_job.outputs.file-name-lower }}-${{needs.nightly_job.outputs.tag-name}}.exe > C:/appPackage.exe
curl -L https://github.com/${{ needs.nightly_job.outputs.repository }}/releases/download/${{needs.nightly_job.outputs.tag-name}}/${{ needs.nightly_job.outputs.file-name-lower }}-${{needs.nightly_job.outputs.tag-name}}.msi > C:/appPackage.msi
shell: bash
- name: Install ${{ needs.nightly_job.outputs.file-name-lower }}.msi
run: |
Start-Process msiexec -ArgumentList "/quiet","/i","C:\appPackage.msi"
shell: powershell
- name: Install ${{ needs.nightly_job.outputs.file-name-lower }}.exe
run: |
Start-Process -FilePath "C:\appPackage.exe" -Verb runAs -ArgumentList '/s','/v"/qn"'
Start-Sleep -s 30
shell: powershell
- name: E2E appium test for msi 🧪
uses: nick-fields/retry@v2
with:
timeout_seconds: 1800
max_attempts: 2
shell: bash
retry_on: error
command: |
taskkill //F //IM "${{ needs.nightly_job.outputs.display-name }}.exe" || (echo "app is ready")
sleep 10s
export APP_TYPE=msi
yarn test:release
unset APP_TYPE
- name: E2E appium test for exe 🧪
uses: nick-fields/retry@v2
with:
timeout_seconds: 1800
max_attempts: 2
shell: bash
retry_on: error
command: |
taskkill //F //IM "${{ needs.nightly_job.outputs.display-name }}.exe" || (echo "app is ready")
sleep 10s
export APP_TYPE=exe
yarn test:release
unset APP_TYPE