forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
1062 lines (943 loc) · 43.9 KB
/
codeoss-ci.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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CodeOSS CI
on:
push:
branches:
- dev/*
tags:
- v*.*.*
pull_request:
branches:
- $default-branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_VERSION: 16
PYTHON_VERSION: "3.x"
RUST_VERSION: 1.65.0
CODE_ICO_URL: https://github.com/LcJuves/vscode/raw/94cba4eb314f52fd18b47b72459954fda65302d0/resources/win32/code.ico
VSCODE_STEP_ON_IT: false
CACHE_VERSION: 1691245569
PUBLISH_NAME: dev_test_part31
PUBLISH_TAG_NAME: dev_test_part31
PRE_RELEASE: true
defaults:
run:
shell: bash
jobs:
generate-product-configurations:
name: Generate product configurations
runs-on: windows-2019
outputs:
application-name: ${{ steps.write-job-variables.outputs.application-name }}
tunnel-application-name: ${{ steps.write-job-variables.outputs.tunnel-application-name }}
name-short: ${{ steps.write-job-variables.outputs.name-short }}
vscode-quality: ${{ steps.write-job-variables.outputs.vscode-quality }}
version: ${{ steps.write-job-variables.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Compute product configurations cache key
id: compute-product-configurations-cache-key
run: |
GITHUB_API_URL=https://api.github.com/repos/microsoft/vscode/releases
curl -H "Accept: application/vnd.github.v3+json" -s $GITHUB_API_URL >releases.json
# shellcheck disable=SC2034
REMOTE_VERSION=$(node -p "require('./releases.json')[0]['tag_name']")
VERSION=$(node -p "require('./package.json')['version']")
echo "VERSION=$VERSION" >>"$GITHUB_ENV"
UNIVERSAL_ZIP_VERSION=$VERSION
[ "$GITHUB_REF_NAME" == "dev/real-time-synchronization" ] && UNIVERSAL_ZIP_VERSION=$REMOTE_VERSION
VS_ZIP_URL="https://update.code.visualstudio.com/${UNIVERSAL_ZIP_VERSION}/darwin-universal/stable"
CURL_DO_URL=$(curl -is "$VS_ZIP_URL" | grep Location | awk -F ": " '{print $2}' | tr -d "\r|\n")
echo "CURL_DO_URL=$CURL_DO_URL" >>"$GITHUB_ENV"
echo "key=$(echo "$CURL_DO_URL#$CACHE_VERSION" | sha512sum | awk '{print $1}')" >>"$GITHUB_OUTPUT"
- name: Cache product configurations
id: cache-product-configurations
uses: actions/cache@v3
with:
path: |
product.json
resources/win32/VisualElementsManifest.xml
resources/server/manifest.json
resources/linux/AppImage.yml
key: "${{ runner.os }}${{ steps.compute-product-configurations-cache-key.outputs.key }}"
- name: Do generating ...
if: ${{ steps.cache-product-configurations.outputs.cache-hit != 'true' }}
run: |
VS_ZIP_NAME="VSCode-darwin-universal.zip"
curl -L -s -o $VS_ZIP_NAME "$CURL_DO_URL"
VS_PRODUCT_JSON_PATH="Visual Studio Code.app/Contents/Resources/app/product.json"
unzip $VS_ZIP_NAME "$VS_PRODUCT_JSON_PATH"
cp "$VS_PRODUCT_JSON_PATH" vs-product.json
node .github/generateProductConfigurations.js
- name: Publish product configurations
uses: actions/upload-artifact@v3
with:
name: Product configurations
path: |
product.json
resources/win32/VisualElementsManifest.xml
resources/server/manifest.json
resources/linux/AppImage.yml
- name: Write job variables
id: write-job-variables
run: |
echo "application-name=$(node -p "require('./product.json')['applicationName']")" >>"$GITHUB_OUTPUT"
echo "tunnel-application-name=$(node -p "require('./product.json')['tunnelApplicationName']")" >>"$GITHUB_OUTPUT"
echo "name-short=$(node -p "require('./product.json')['nameShort']")" >>"$GITHUB_OUTPUT"
echo "vscode-quality=$(node -p "require('./product.json')['quality']||'oss'")" >>"$GITHUB_OUTPUT"
echo "version=$VERSION" >>"$GITHUB_OUTPUT"
compile:
name: Compile
runs-on: ubuntu-20.04
needs: generate-product-configurations
env:
VSCODE_ARCH: x64
VSCODE_QUALITY: ${{ needs.generate-product-configurations.outputs.vscode-quality }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Download product configurations
uses: actions/download-artifact@v3
with:
name: Product configurations
- name: Install build tools
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
sudo apt update -y
sudo apt install -y build-essential pkg-config libx11-dev libx11-xcb-dev libxkbfile-dev libsecret-1-dev libnotify-bin libkrb5-dev
- name: Compute node modules cache key
id: compute-node-modules-cache-key
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js compile)" >>"$GITHUB_OUTPUT"
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: ".build/node_modules_cache"
key: "${{ runner.os }}GenericNodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}"
- name: Extract node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }}
run: tar -xJf .build/node_modules_cache/cache.tar.xz
- name: Install dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
for i in {1..5}; do # try 5 times
yarn --frozen-lockfile --check-files && break
if [ "$i" -eq 3 ]; then
echo "Yarn failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
done
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- name: Create node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
mkdir -p .build/node_modules_cache
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
tar -cJf .build/node_modules_cache/cache.tar.xz -T .build/node_modules_list.txt
- name: Install built-in extensions
uses: ./.github/workflows/install-builtin-extensions
with:
cache-version: ${{ env.CACHE_VERSION }}
- name: Compile & Hygiene
timeout-minutes: 90
run: |
yarn npm-run-all -lp --max-parallel 3 \
core-ci extensions-ci hygiene eslint \
valid-layers-check vscode-dts-compile-check tsec-compile-check
- name: Compile test suites
if: ${{ env.VSCODE_STEP_ON_IT == 'false' }}
run: |
yarn --cwd test/smoke compile
yarn --cwd test/integration/browser compile
- name: Compute openssl prebuilt cache key
id: compute-openssl-prebuilt-cache-key
run: echo "key=$(echo "OPENSSL_PREBUILT#$CACHE_VERSION" | sha512sum | awk '{print $1}')" >>"$GITHUB_OUTPUT"
- name: Cache openssl prebuilt
id: cache-openssl-prebuilt
uses: actions/cache@v3
with:
path: openssl
key: "${{ runner.os }}${{ steps.compute-openssl-prebuilt-cache-key.outputs.key }}"
- name: Download & Extract openssl prebuilt
if: ${{ steps.cache-openssl-prebuilt.outputs.cache-hit != 'true' }}
run: |
OPENSSL_PREBUILT_VERSION=0.0.5
npm pack @vscode/openssl-prebuilt@$OPENSSL_PREBUILT_VERSION
mkdir openssl
tar -xvzf vscode-openssl-prebuilt-$OPENSSL_PREBUILT_VERSION.tgz --strip-components=2 -C openssl package/out/
- name: Compress compilation artifact
run: |
tar -cvJ --ignore-failed-read \
--exclude='.build/node_modules_cache' \
--exclude='.build/node_modules_list.txt' \
--exclude='.build/distro' \
-f compilation.tar.xz \
.build out-* test/integration/browser/out test/smoke/out test/automation/out openssl
- name: Publish compilation artifact
uses: actions/upload-artifact@v3
with:
name: Compilation
path: compilation.tar.xz
build-for-linux:
name: Build for Linux
runs-on: ubuntu-20.04
container:
image: vscodehub.azurecr.io/vscode-linux-build-agent:${{ matrix.image-tag }}
options: --user 0:0 --cap-add SYS_ADMIN
needs: [generate-product-configurations, compile]
strategy:
matrix:
include:
- arch: x64
image-tag: bionic-x64
rust-host-triple: x86_64-unknown-linux-gnu
- arch: arm64
image-tag: stretch-arm64
rust-host-triple: aarch64-unknown-linux-gnu
- arch: armhf
image-tag: stretch-armhf
rust-host-triple: armv7-unknown-linux-gnueabihf
env:
VSCODE_ARCH: ${{ matrix.arch }}
APPLICATION_NAME: ${{ needs.generate-product-configurations.outputs.application-name }}
CLI_APP_NAME: ${{ needs.generate-product-configurations.outputs.tunnel-application-name }}
NAME_SHORT: ${{ needs.generate-product-configurations.outputs.name-short }}
VSCODE_QUALITY: ${{ needs.generate-product-configurations.outputs.vscode-quality }}
VERSION: ${{ needs.generate-product-configurations.outputs.version }}
RUST_HOST_TRIPLE: ${{ matrix.rust-host-triple }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: ATiltedTree/setup-rust@v1.0.5
with:
rust-version: ${{ env.RUST_VERSION }}
targets: ${{ matrix.rust-host-triple }}
- name: Download product configurations
uses: actions/download-artifact@v3
with:
name: Product configurations
- name: Initialize job variables
run: |
NPM_ARCH=$VSCODE_ARCH
[ "${NPM_ARCH}" == "armhf" ] && NPM_ARCH=armv7l
echo "NPM_ARCH=$NPM_ARCH" >>"$GITHUB_ENV"
[ "$VSCODE_ARCH" == "x64" ] && echo "DISPLAY=:10" >>"$GITHUB_ENV"
- name: Setup system services
if: ${{ env.VSCODE_ARCH == 'x64' }}
run: |
# Start X server
/etc/init.d/xvfb start
# Start dbus session
DBUS_LAUNCH_RESULT=$(sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address)
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_LAUNCH_RESULT" >>"$GITHUB_ENV"
- name: Download compilation output
uses: actions/download-artifact@v3
with:
name: Compilation
- name: Extract compilation output
run: tar -xJf compilation.tar.xz
- name: Compute node modules cache key
id: compute-node-modules-cache-key
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js linux $VSCODE_ARCH)" >>"$GITHUB_OUTPUT"
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: ".build/node_modules_cache"
key: "${{ runner.os }}NodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}"
- name: Extract node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }}
run: tar -xJf .build/node_modules_cache/cache.tar.xz
- name: Install build dependencies
run: |
node build/npm/setupBuildYarnrc
for i in {1..3}; do
yarn --cwd build --frozen-lockfile --check-files && break
if [ "$i" -eq 3 ]; then
echo "Yarn failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
done
- name: Install dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
if [ "$NPM_ARCH" = "armv7l" ]; then
# There is no target_arch="armv7l" supported by node_gyp,
# arm versions for compilation are decided based on the CC
# macros.
# Mapping value is based on
# https://github.com/nodejs/node/blob/0903515e126c2697042d6546c6aa4b72e1a4b33e/configure.py#L49-L50
npm_config_arch="arm"
else
npm_config_arch=$NPM_ARCH
fi
export npm_config_arch
if [ -z "$CC" ] || [ -z "$CXX" ]; then
# Download clang based on chromium revision used by vscode
curl -s https://raw.githubusercontent.com/chromium/chromium/98.0.4758.109/tools/clang/scripts/update.py |
python - --output-dir="$PWD"/.build/CR_Clang --host-os=linux
# Download libcxx headers and objects from upstream electron releases
DEBUG=libcxx-fetcher \
VSCODE_LIBCXX_OBJECTS_DIR=$PWD/.build/libcxx-objects \
VSCODE_LIBCXX_HEADERS_DIR=$PWD/.build/libcxx_headers \
VSCODE_LIBCXXABI_HEADERS_DIR=$PWD/.build/libcxxabi_headers \
VSCODE_ARCH="$NPM_ARCH" \
node build/linux/libcxx-fetcher.js
# Set compiler toolchain
# Flags for the client build are based on
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/arm.gni
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/compiler/BUILD.gn
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/c++/BUILD.gn
export CC="$PWD"/.build/CR_Clang/bin/clang
export CXX="$PWD"/.build/CR_Clang/bin/clang++
export CXXFLAGS="-nostdinc++ -D__NO_INLINE__ -isystem$PWD/.build/libcxx_headers -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit"
export LDFLAGS="-stdlib=libc++ -fuse-ld=lld -flto=thin -L$PWD/.build/libcxx-objects -lc++abi -Wl,--lto-O0"
# shellcheck disable=SC2155
export VSCODE_REMOTE_CC="$(which gcc)"
# shellcheck disable=SC2155
export VSCODE_REMOTE_CXX="$(which g++)"
fi
for i in {1..3}; do
yarn --frozen-lockfile --check-files && break
if [ "$i" -eq 3 ]; then
echo "Yarn failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
done
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- name: Create node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
mkdir -p .build/node_modules_cache
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
tar -cJf .build/node_modules_cache/cache.tar.xz --files-from .build/node_modules_list.txt
- name: Install built-in extensions
uses: ./.github/workflows/install-builtin-extensions
with:
cache-version: ${{ env.CACHE_VERSION }}
- name: Build client artifacts
run: |
BUILD_VERSION="$(date +%s)"
echo "::group::Build binary package"
yarn gulp vscode-linux-${VSCODE_ARCH}-min-ci
BUILD=$NAME_SHORT-linux-${VSCODE_ARCH}
(cd .. && cp -r VSCode-linux-${VSCODE_ARCH} $BUILD)
[ -z "${VSCODE_QUALITY}" ] &&
XZ_TARBALL_NAME="${APPLICATION_NAME}-${VSCODE_ARCH}-$BUILD_VERSION.tar.xz" ||
XZ_TARBALL_NAME="${APPLICATION_NAME}-${VSCODE_QUALITY}-${VSCODE_ARCH}-$BUILD_VERSION.tar.xz"
(cd .. && tar -cJf "$XZ_TARBALL_NAME" $BUILD)
mv ../"$XZ_TARBALL_NAME" .
echo "XZ_TARBALL_NAME=$XZ_TARBALL_NAME" >>"$GITHUB_ENV"
[ -z "${VSCODE_QUALITY}" ] &&
GZ_TARBALL_NAME="${APPLICATION_NAME}-${VSCODE_ARCH}-$BUILD_VERSION.tar.gz" ||
GZ_TARBALL_NAME="${APPLICATION_NAME}-${VSCODE_QUALITY}-${VSCODE_ARCH}-$BUILD_VERSION.tar.gz"
(cd .. && tar -zcf "$GZ_TARBALL_NAME" $BUILD)
mv ../"$GZ_TARBALL_NAME" .
echo "GZ_TARBALL_NAME=$GZ_TARBALL_NAME" >>"$GITHUB_ENV"
echo "::endgroup::"
echo "::group::Build rpm package"
yarn gulp vscode-linux-${VSCODE_ARCH}-build-rpm
case $VSCODE_ARCH in
x64) RPM_ARCH="x86_64" ;;
armhf) RPM_ARCH="armv7hl" ;;
arm64) RPM_ARCH="aarch64" ;;
*) RPM_ARCH="$VSCODE_ARCH" ;;
esac
RPM_OUT_DIR=.build/linux/rpm/$RPM_ARCH
RPM_FILENAME="$(cd $RPM_OUT_DIR && (ls ./*.rpm) | awk -F "./" 'NR==1{print $2}')"
mv "$RPM_OUT_DIR/$RPM_FILENAME" .
echo "RPM_FILENAME=$RPM_FILENAME" >>"$GITHUB_ENV"
echo "::endgroup::"
echo "::group::Build deb package"
yarn gulp vscode-linux-${VSCODE_ARCH}-build-deb
case $VSCODE_ARCH in
x64) DEB_ARCH="amd64" ;;
*) DEB_ARCH="$VSCODE_ARCH" ;;
esac
DEB_OUT_DIR=.build/linux/deb/$DEB_ARCH/deb
DEB_FILENAME="$(cd $DEB_OUT_DIR && (ls ./*.deb) | awk -F "./" 'NR==1{print $2}')"
mv "$DEB_OUT_DIR/$DEB_FILENAME" .
echo "DEB_FILENAME=$DEB_FILENAME" >>"$GITHUB_ENV"
echo "::endgroup::"
if [ "$VSCODE_ARCH" == "x64" ]; then
echo "::group::Build AppImage package"
npm install -g @liangchengj/nfserv && (nfserv >nfserv.log 2>&1 &) && (sleep 6 && cat nfserv.log)
DOWNLOAD_URL="http://127.0.0.1:9934/$DEB_FILENAME"
echo "DOWNLOAD_URL >>> $DOWNLOAD_URL" && export DOWNLOAD_URL
GITHUB_API_URL=https://api.github.com/repos/AppImage/pkg2appimage/releases
curl -H "Accept: application/vnd.github.v3+json" -s $GITHUB_API_URL >releases.json
BROWSER_DOWNLOAD_URL=$(node -p "require('./releases.json')[0]['assets'][0]['browser_download_url']")
curl -L -O -s "$BROWSER_DOWNLOAD_URL" && chmod u+x "$PWD/${BROWSER_DOWNLOAD_URL##*/}"
"$PWD/${BROWSER_DOWNLOAD_URL##*/}" "$APPIMAGE_YML_PATH"
APPIMAGE_FILENAME=$NAME_SHORT-linux-${VSCODE_ARCH}-$VERSION.AppImage
mv out/*.AppImage "$APPIMAGE_FILENAME"
echo "APPIMAGE_FILENAME=$APPIMAGE_FILENAME" >>"$GITHUB_ENV"
echo "::endgroup::"
fi
echo "::group::Build snap package"
set -x
yarn gulp vscode-linux-$VSCODE_ARCH-prepare-snap
SNAP_FILENAME="$APPLICATION_NAME-$VSCODE_QUALITY-$VSCODE_ARCH-$BUILD_VERSION.snap"
echo "SNAP_FILENAME=$SNAP_FILENAME" >>"$GITHUB_ENV"
DOCKER_IMAGE_NAME="docker.io/snapcore/snapcraft:stable"
SNAP_BUILD_SH_NAME="snap-build-$BUILD_VERSION.sh"
cat <<'EOF' >"$PWD/$SNAP_BUILD_SH_NAME"
cd /workspace || exit
# Make sure we get latest packages
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y curl apt-transport-https ca-certificates
# Get snapcraft version
snapcraft --version
SNAP_ROOT="$PWD/.build/linux/snap/${VSCODE_ARCH}"
SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME"
case $VSCODE_ARCH in
x64) SNAP_ARCH="amd64" ;;
*) SNAP_ARCH="$VSCODE_ARCH" ;;
esac
(cd "$SNAP_ROOT/$APPLICATION_NAME-$VSCODE_ARCH" &&
sudo --preserve-env snapcraft prime --target-arch "$SNAP_ARCH" &&
snap pack prime --compression=lzo --filename="$SNAP_PATH")
mv "$SNAP_PATH" .
EOF
exec docker run -v "$PWD:/workspace" \
-e APPLICATION_NAME=$APPLICATION_NAME \
-e VSCODE_ARCH=$VSCODE_ARCH \
-e SNAP_FILENAME=$SNAP_FILENAME \
--entrypoint=bash $DOCKER_IMAGE_NAME -ex "/workspace/$SNAP_BUILD_SH_NAME"
echo "::endgroup::"
- name: Build server artifacts
run: |
yarn gulp vscode-reh-linux-${VSCODE_ARCH}-min-ci
SERVER_BUILD_NAME="$APPLICATION_NAME-server-linux-${VSCODE_ARCH}"
SERVER_TARBALL_FILENAME="$SERVER_BUILD_NAME.tar.gz"
(cd .. && cp -r vscode-reh-linux-${VSCODE_ARCH} $SERVER_BUILD_NAME)
(cd .. && tar -zcf $SERVER_TARBALL_FILENAME $SERVER_BUILD_NAME)
mv ../$SERVER_TARBALL_FILENAME .
echo "SERVER_TARBALL_FILENAME=$SERVER_TARBALL_FILENAME" >>"$GITHUB_ENV"
yarn gulp vscode-reh-web-linux-${VSCODE_ARCH}-min-ci
SERVER_WEB_BUILD_NAME="$APPLICATION_NAME-server-linux-${VSCODE_ARCH}-web"
SERVER_WEB_TARBALL_FILENAME="$SERVER_WEB_BUILD_NAME.tar.gz"
(cd .. && cp -r vscode-reh-web-linux-${VSCODE_ARCH} $SERVER_WEB_BUILD_NAME)
(cd .. && tar -zcf $SERVER_WEB_TARBALL_FILENAME $SERVER_WEB_BUILD_NAME)
mv ../$SERVER_WEB_TARBALL_FILENAME .
echo "SERVER_WEB_TARBALL_FILENAME=$SERVER_WEB_TARBALL_FILENAME" >>"$GITHUB_ENV"
- name: Generate SHA512 checksum files
run: |
gensha512() { (sha512sum "$1" | awk '{print $1}' >"$1".sha512); }
[ -f "$XZ_TARBALL_NAME" ] && gensha512 "$XZ_TARBALL_NAME"
[ -f "$GZ_TARBALL_NAME" ] && gensha512 "$GZ_TARBALL_NAME"
[ -f "$SERVER_TARBALL_FILENAME" ] && gensha512 "$SERVER_TARBALL_FILENAME"
[ -f "$SERVER_WEB_TARBALL_FILENAME" ] && gensha512 "$SERVER_WEB_TARBALL_FILENAME"
[ -f "$RPM_FILENAME" ] && gensha512 "$RPM_FILENAME"
[ -f "$DEB_FILENAME" ] && gensha512 "$DEB_FILENAME"
[ -f "$SNAP_FILENAME" ] && gensha512 "$SNAP_FILENAME"
[ -f "$APPIMAGE_FILENAME" ] && gensha512 "$APPIMAGE_FILENAME"
- name: Switch to tag name
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV"
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV"
echo "PRE_RELEASE=false" >>"$GITHUB_ENV"
- name: Publish artifacts
uses: softprops/action-gh-release@v1
with:
name: ${{ env.PUBLISH_NAME }}
tag_name: ${{ env.PUBLISH_TAG_NAME }}
prerelease: ${{ env.PRE_RELEASE }}
files: |
${{ env.XZ_TARBALL_NAME }}
${{ env.XZ_TARBALL_NAME }}.sha512
${{ env.GZ_TARBALL_NAME }}
${{ env.GZ_TARBALL_NAME }}.sha512
${{ env.RPM_FILENAME }}
${{ env.RPM_FILENAME }}.sha512
${{ env.DEB_FILENAME }}
${{ env.DEB_FILENAME }}.sha512
${{ env.SNAP_FILENAME }}
${{ env.SNAP_FILENAME }}.sha512
${{ env.APPIMAGE_FILENAME }}
${{ env.APPIMAGE_FILENAME }}.sha512
${{ env.SERVER_TARBALL_FILENAME }}
${{ env.SERVER_TARBALL_FILENAME }}.sha512
${{ env.SERVER_WEB_TARBALL_FILENAME }}
${{ env.SERVER_WEB_TARBALL_FILENAME }}.sha512
build-for-macos:
name: Build for macOS
runs-on: macos-11
needs: [generate-product-configurations, compile]
strategy:
matrix:
include:
- arch: x64
rust-host-triple-arch: x86_64
- arch: arm64
rust-host-triple-arch: aarch64
env:
VSCODE_ARCH: ${{ matrix.arch }}
APPLICATION_NAME: ${{ needs.generate-product-configurations.outputs.application-name }}
CLI_APP_NAME: ${{ needs.generate-product-configurations.outputs.tunnel-application-name }}
NAME_SHORT: ${{ needs.generate-product-configurations.outputs.name-short }}
RUST_HOST_TRIPLE: ${{ matrix.rust-host-triple-arch }}-apple-darwin
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: ATiltedTree/setup-rust@v1.0.5
with:
rust-version: ${{ env.RUST_VERSION }}
targets: ${{ env.RUST_HOST_TRIPLE }}
- name: Download product configurations
uses: actions/download-artifact@v3
with:
name: Product configurations
- name: Download compilation output
uses: actions/download-artifact@v3
with:
name: Compilation
- name: Extract compilation output
run: tar -xJf compilation.tar.xz
- name: Compute node modules cache key
id: compute-node-modules-cache-key
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js darwin $VSCODE_ARCH)" >>"$GITHUB_OUTPUT"
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: ".build/node_modules_cache"
key: "${{ runner.os }}NodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}"
- name: Extract node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }}
run: tar -xJf .build/node_modules_cache/cache.tar.xz
- name: Install dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
npm install -g node-gyp@latest
npm_config_arch=$VSCODE_ARCH
export npm_config_arch
npm_config_node_gyp=$(which node-gyp)
export npm_config_node_gyp
for i in {1..5}; do # try 5 times
yarn --frozen-lockfile --check-files && break
if [ $i -eq 3 ]; then
echo "Yarn failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
done
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- name: Create node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
mkdir -p .build/node_modules_cache
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
tar -cJf .build/node_modules_cache/cache.tar.xz --files-from .build/node_modules_list.txt
- name: Install built-in extensions
uses: ./.github/workflows/install-builtin-extensions
with:
cache-version: ${{ env.CACHE_VERSION }}
- name: Build client artifacts
run: |
yarn gulp vscode-darwin-${VSCODE_ARCH}-min-ci
BUILD=$NAME_SHORT-darwin-${VSCODE_ARCH}
(cd .. && cp -r VSCode-darwin-${VSCODE_ARCH} $BUILD)
export OPENSSL_LIB_DIR="$PWD/openssl/${VSCODE_ARCH}-osx/lib"
export OPENSSL_INCLUDE_DIR="$PWD/openssl/${VSCODE_ARCH}-osx/include"
(cd cli && cargo build --release --target "$RUST_HOST_TRIPLE" --bin=code)
APP_NAME="$(cd ../$BUILD && ls . | head -n 1)"
mv cli/target/"$RUST_HOST_TRIPLE"/release/code ../$BUILD/"$APP_NAME"/Contents/Resources/app/bin/"$CLI_APP_NAME"
XZ_TARBALL_NAME=$BUILD.tar.xz
(cd ../$BUILD && tar -cJf ../$XZ_TARBALL_NAME ./*.app)
mv ../$XZ_TARBALL_NAME .
echo "XZ_TARBALL_NAME=$XZ_TARBALL_NAME" >>"$GITHUB_ENV"
ZIP_NAME=$BUILD.zip
(cd ../$BUILD && zip -Xry -q ../$ZIP_NAME ./*.app)
mv ../$ZIP_NAME .
echo "ZIP_NAME=$ZIP_NAME" >>"$GITHUB_ENV"
- name: Build server artifacts
run: |
yarn gulp vscode-reh-darwin-$VSCODE_ARCH-min-ci
SERVER_BUILD_NAME="$APPLICATION_NAME-server-darwin-$VSCODE_ARCH"
SERVER_ZIP_NAME="$SERVER_BUILD_NAME.zip"
(cd .. && cp -r vscode-reh-darwin-$VSCODE_ARCH $SERVER_BUILD_NAME)
(cd .. && zip -Xry -q $SERVER_ZIP_NAME $SERVER_BUILD_NAME)
mv ../$SERVER_ZIP_NAME .
echo "SERVER_ZIP_NAME=$SERVER_ZIP_NAME" >>"$GITHUB_ENV"
yarn gulp vscode-reh-web-darwin-$VSCODE_ARCH-min-ci
SERVER_WEB_BUILD_NAME="$APPLICATION_NAME-server-darwin-$VSCODE_ARCH-web"
SERVER_WEB_ZIP_NAME="$SERVER_WEB_BUILD_NAME.zip"
(cd .. && cp -r vscode-reh-web-darwin-$VSCODE_ARCH $SERVER_WEB_BUILD_NAME)
(cd .. && zip -Xry -q $SERVER_WEB_ZIP_NAME $SERVER_WEB_BUILD_NAME)
mv ../$SERVER_WEB_ZIP_NAME .
echo "SERVER_WEB_ZIP_NAME=$SERVER_WEB_ZIP_NAME" >>"$GITHUB_ENV"
- name: Generate SHA512 checksum files
run: |
gensha512() { (shasum -a 512 "$1" | awk '{print $1}' >"$1".sha512); }
[ -f "$XZ_TARBALL_NAME" ] && gensha512 "$XZ_TARBALL_NAME"
[ -f "$ZIP_NAME" ] && gensha512 "$ZIP_NAME"
[ -f "$SERVER_ZIP_NAME" ] && gensha512 "$SERVER_ZIP_NAME"
[ -f "$SERVER_WEB_ZIP_NAME" ] && gensha512 "$SERVER_WEB_ZIP_NAME"
- name: Switch to tag name
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV"
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV"
echo "PRE_RELEASE=false" >>"$GITHUB_ENV"
- name: Publish artifacts
uses: softprops/action-gh-release@v1
with:
name: ${{ env.PUBLISH_NAME }}
tag_name: ${{ env.PUBLISH_TAG_NAME }}
prerelease: ${{ env.PRE_RELEASE }}
files: |
${{ env.XZ_TARBALL_NAME }}
${{ env.XZ_TARBALL_NAME }}.sha512
${{ env.ZIP_NAME }}
${{ env.ZIP_NAME }}.sha512
${{ env.SERVER_ZIP_NAME }}
${{ env.SERVER_ZIP_NAME }}.sha512
${{ env.SERVER_WEB_ZIP_NAME }}
${{ env.SERVER_WEB_ZIP_NAME }}.sha512
build-universal-application:
name: Build universal application
runs-on: macos-11
needs: [generate-product-configurations, build-for-macos]
env:
VSCODE_ARCH: universal
NAME_SHORT: ${{ needs.generate-product-configurations.outputs.name-short }}
GITHUB_REPOSITORY: ${{ github.repository }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Download product configurations
uses: actions/download-artifact@v3
with:
name: Product configurations
- name: Compute node modules cache key
id: compute-node-modules-cache-key
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js darwin x64)" >>"$GITHUB_OUTPUT"
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: ".build/node_modules_cache"
key: "${{ runner.os }}NodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}"
- name: Extract node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }}
run: tar -xJf .build/node_modules_cache/cache.tar.xz
- name: Create Universal App
run: |
AGENT_BUILDDIRECTORY="$(cd .. && pwd)"
DOWNLOAD_URL_PREFIX="https://github.com/$GITHUB_REPOSITORY/releases/download/$PUBLISH_TAG_NAME"
curl -L -O -s "$DOWNLOAD_URL_PREFIX/$NAME_SHORT-darwin-arm64.tar.xz"
curl -L -O -s "$DOWNLOAD_URL_PREFIX/$NAME_SHORT-darwin-x64.tar.xz"
tar -xJf "$NAME_SHORT-darwin-arm64.tar.xz"
mkdir ../VSCode-darwin-arm64 && mv ./*.app ../VSCode-darwin-arm64/
tar -xJf "$NAME_SHORT-darwin-x64.tar.xz"
mkdir ../VSCode-darwin-x64 && mv ./*.app ../VSCode-darwin-x64/
DEBUG=* node build/darwin/create-universal-app.js "$AGENT_BUILDDIRECTORY"
BUILD=$NAME_SHORT-darwin-${VSCODE_ARCH}
(cd .. && cp -r VSCode-darwin-${VSCODE_ARCH} $BUILD)
XZ_TARBALL_NAME=$BUILD.tar.xz
(cd ../$BUILD && tar -cJf ../$XZ_TARBALL_NAME ./*.app)
mv ../$XZ_TARBALL_NAME .
echo "XZ_TARBALL_NAME=$XZ_TARBALL_NAME" >>"$GITHUB_ENV"
ZIP_NAME=$BUILD.zip
(cd ../$BUILD && zip -r -X -y -q ../$ZIP_NAME ./*.app)
mv ../$ZIP_NAME .
echo "ZIP_NAME=$ZIP_NAME" >>"$GITHUB_ENV"
- name: Generate SHA512 checksum files
run: |
gensha512() { (shasum -a 512 "$1" | awk '{print $1}' >"$1".sha512); }
[ -f "$XZ_TARBALL_NAME" ] && gensha512 "$XZ_TARBALL_NAME"
[ -f "$ZIP_NAME" ] && gensha512 "$ZIP_NAME"
- name: Switch to tag name
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV"
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV"
echo "PRE_RELEASE=false" >>"$GITHUB_ENV"
- name: Publish artifacts
uses: softprops/action-gh-release@v1
with:
name: ${{ env.PUBLISH_NAME }}
tag_name: ${{ env.PUBLISH_TAG_NAME }}
prerelease: ${{ env.PRE_RELEASE }}
files: |
${{ env.XZ_TARBALL_NAME }}
${{ env.XZ_TARBALL_NAME }}.sha512
${{ env.ZIP_NAME }}
${{ env.ZIP_NAME }}.sha512
build-for-windows:
name: Build for Windows
runs-on: windows-2019
needs: [generate-product-configurations, compile]
strategy:
matrix:
include:
- arch: x64
rust-host-triple-arch: x86_64
- arch: arm64
rust-host-triple-arch: aarch64
- arch: ia32
rust-host-triple-arch: i686
env:
VSCODE_ARCH: ${{ matrix.arch }}
APPLICATION_NAME: ${{ needs.generate-product-configurations.outputs.application-name }}
CLI_APP_NAME: ${{ needs.generate-product-configurations.outputs.tunnel-application-name }}
NAME_SHORT: ${{ needs.generate-product-configurations.outputs.name-short }}
VERSION: ${{ needs.generate-product-configurations.outputs.version }}
RUST_HOST_TRIPLE: ${{ matrix.rust-host-triple-arch }}-pc-windows-msvc
RUSTFLAGS: "-C target-feature=+crt-static"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: ATiltedTree/setup-rust@v1.0.5
with:
rust-version: ${{ env.RUST_VERSION }}
targets: ${{ env.RUST_HOST_TRIPLE }}
- name: Download product configurations
uses: actions/download-artifact@v3
with:
name: Product configurations
- name: Download compilation output
uses: actions/download-artifact@v3
with:
name: Compilation
- name: Extract compilation output
run: tar -xJf compilation.tar.xz
- name: Compute node modules cache key
id: compute-node-modules-cache-key
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js win32 $VSCODE_ARCH)" >>"$GITHUB_OUTPUT"
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: ".build/node_modules_cache"
key: "${{ runner.os }}NodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}"
- name: Extract node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }}
run: tar -xJf .build/node_modules_cache/cache.tar.xz
- name: Install dependencies
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
npm_config_arch=${VSCODE_ARCH}
export npm_config_arch
CHILD_CONCURRENCY="1"
export CHILD_CONCURRENCY
for i in {1..3}; do
yarn --frozen-lockfile --check-files && break
if [ "$i" -eq 3 ]; then
echo "Yarn failed too many times" >&2
exit 1
fi
echo "Yarn failed $i, trying again..."
done
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- name: Create node modules archive
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
run: |
mkdir -p .build/node_modules_cache
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
tar -cJf .build/node_modules_cache/cache.tar.xz --files-from .build/node_modules_list.txt
- name: Install built-in extensions
uses: ./.github/workflows/install-builtin-extensions
with:
cache-version: ${{ env.CACHE_VERSION }}
- name: Build client artifacts
run: |
echo "::group::Build binary package"
yarn gulp vscode-win32-${VSCODE_ARCH}-min-ci
OPENSSL_PREBUILT_ARCH=$([ "$VSCODE_ARCH" == "ia32" ] && echo "x86" || echo "$VSCODE_ARCH")
export OPENSSL_LIB_DIR="$PWD/openssl/${OPENSSL_PREBUILT_ARCH}-windows-static-md/lib"
export OPENSSL_INCLUDE_DIR="$PWD/openssl/${OPENSSL_PREBUILT_ARCH}-windows-static-md/include"
(cd cli && cargo build --release --target "$RUST_HOST_TRIPLE" --bin=code)
DEFAULT_BUILD=VSCode-win32-${VSCODE_ARCH}
mv cli/target/"$RUST_HOST_TRIPLE"/release/code.exe ../$DEFAULT_BUILD/bin/"$CLI_APP_NAME.exe"
BUILD=$NAME_SHORT-win32-${VSCODE_ARCH}
(cd .. && cp -r $DEFAULT_BUILD $BUILD)
XZ_TARBALL_NAME=$BUILD-$VERSION.tar.xz
(cd .. && tar -cJf $XZ_TARBALL_NAME $BUILD)
mv ../$XZ_TARBALL_NAME .
echo "XZ_TARBALL_NAME=$XZ_TARBALL_NAME" >>"$GITHUB_ENV"
ZIP_NAME=$BUILD-$VERSION.zip
(cd .. && 7z a -tzip $ZIP_NAME -x!CodeSignSummary*.md $BUILD -r)
mv ../$ZIP_NAME .
echo "ZIP_NAME=$ZIP_NAME" >>"$GITHUB_ENV"
echo "::endgroup::"
yarn gulp vscode-win32-${VSCODE_ARCH}-inno-updater
curl -L -s -o resources/win32/code.ico $CODE_ICO_URL
echo "::group::Build system setup installer"
yarn gulp vscode-win32-${VSCODE_ARCH}-system-setup
SYSTEM_SETUP_NAME=${NAME_SHORT}Setup-${VSCODE_ARCH}-$VERSION.exe
mv .build/win32-${VSCODE_ARCH}/system-setup/VSCodeSetup.exe $SYSTEM_SETUP_NAME
echo "SYSTEM_SETUP_NAME=$SYSTEM_SETUP_NAME" >>"$GITHUB_ENV"
echo "::endgroup::"
echo "::group::Build user setup installer"
yarn gulp vscode-win32-${VSCODE_ARCH}-user-setup
USER_SETUP_NAME=${NAME_SHORT}UserSetup-${VSCODE_ARCH}-$VERSION.exe
mv .build/win32-${VSCODE_ARCH}/user-setup/VSCodeSetup.exe $USER_SETUP_NAME
echo "USER_SETUP_NAME=$USER_SETUP_NAME" >>"$GITHUB_ENV"
echo "::endgroup::"
- name: Build server artifacts
if: ${{ env.VSCODE_ARCH != 'arm64' }}
run: |
yarn gulp vscode-reh-win32-${VSCODE_ARCH}-min-ci
SERVER_BUILD_NAME="$APPLICATION_NAME-server-win32-${VSCODE_ARCH}"
SERVER_ZIP_NAME="$SERVER_BUILD_NAME.zip"
(cd .. && cp -r vscode-reh-win32-${VSCODE_ARCH} $SERVER_BUILD_NAME)
(cd .. && 7z a -tzip $SERVER_ZIP_NAME $SERVER_BUILD_NAME -r)
mv ../$SERVER_ZIP_NAME .
echo "SERVER_ZIP_NAME=$SERVER_ZIP_NAME" >>"$GITHUB_ENV"
yarn gulp vscode-reh-web-win32-${VSCODE_ARCH}-min-ci
SERVER_WEB_BUILD_NAME="$APPLICATION_NAME-server-win32-${VSCODE_ARCH}-web"
SERVER_WEB_ZIP_NAME="$SERVER_WEB_BUILD_NAME.zip"
(cd .. && cp -r vscode-reh-web-win32-${VSCODE_ARCH} $SERVER_WEB_BUILD_NAME)
(cd .. && 7z a -tzip $SERVER_WEB_ZIP_NAME $SERVER_WEB_BUILD_NAME -r)
mv ../$SERVER_WEB_ZIP_NAME .
echo "SERVER_WEB_ZIP_NAME=$SERVER_WEB_ZIP_NAME" >>"$GITHUB_ENV"
- name: Generate SHA512 checksum files
run: |
gensha512() { (sha512sum "$1" | awk '{print $1}' >"$1".sha512); }
[ -f "$XZ_TARBALL_NAME" ] && gensha512 "$XZ_TARBALL_NAME"
[ -f "$ZIP_NAME" ] && gensha512 "$ZIP_NAME"
[ -f "$SYSTEM_SETUP_NAME" ] && gensha512 "$SYSTEM_SETUP_NAME"
[ -f "$USER_SETUP_NAME" ] && gensha512 "$USER_SETUP_NAME"
[ -f "$SERVER_ZIP_NAME" ] && gensha512 "$SERVER_ZIP_NAME"
[ -f "$SERVER_WEB_ZIP_NAME" ] && gensha512 "$SERVER_WEB_ZIP_NAME"
- name: Switch to tag name
if: startsWith(github.ref, 'refs/tags/v')
run: |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV"
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV"
echo "PRE_RELEASE=false" >>"$GITHUB_ENV"
- name: Publish artifacts
uses: softprops/action-gh-release@v1
with:
name: ${{ env.PUBLISH_NAME }}
tag_name: ${{ env.PUBLISH_TAG_NAME }}
prerelease: ${{ env.PRE_RELEASE }}
files: |
${{ env.XZ_TARBALL_NAME }}
${{ env.XZ_TARBALL_NAME }}.sha512
${{ env.ZIP_NAME }}
${{ env.ZIP_NAME }}.sha512
${{ env.SYSTEM_SETUP_NAME }}
${{ env.SYSTEM_SETUP_NAME }}.sha512
${{ env.USER_SETUP_NAME }}
${{ env.USER_SETUP_NAME }}.sha512
${{ env.SERVER_ZIP_NAME }}
${{ env.SERVER_ZIP_NAME }}.sha512
${{ env.SERVER_WEB_ZIP_NAME }}
${{ env.SERVER_WEB_ZIP_NAME }}.sha512
build-for-web:
name: Build for Web
runs-on: ubuntu-20.04
needs: [generate-product-configurations, compile]
env:
VSCODE_ARCH: x64
APPLICATION_NAME: ${{ needs.generate-product-configurations.outputs.application-name }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Download product configurations
uses: actions/download-artifact@v3
with:
name: Product configurations
- name: Download compilation output
uses: actions/download-artifact@v3
with:
name: Compilation
- name: Extract compilation output
run: tar -xJf compilation.tar.xz
- name: Compute node modules cache key
id: compute-node-modules-cache-key
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js web)" >>"$GITHUB_OUTPUT"
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
with: