@@ -19,65 +19,41 @@ concurrency:
1919
2020jobs :
2121 package-linux :
22- name : ${{ matrix.vscode_target }}
23- runs-on : ubuntu-latest
24- container : " python:3.8-slim-buster "
22+ name : ${{ format('linux-{0}', matrix.vscode_arch) }}
23+ runs-on : ubuntu-22.04
24+
2525 strategy :
2626 matrix :
2727 include :
28- - prefix : x86_64-linux-gnu
29- npm_arch : x64
30- apt_arch : amd64
28+ - npm_arch : x64
29+ vscode_arch : x64
3130 package_arch : amd64
32- vscode_target : linux-x64
33- - prefix : aarch64-linux-gnu
34- npm_arch : arm64
35- apt_arch : arm64
31+ - npm_arch : arm64
32+ vscode_arch : arm64
3633 package_arch : arm64
37- vscode_target : linux-arm64
38- - prefix : arm-linux-gnueabihf
39- npm_arch : armv7l
40- apt_arch : armhf
34+ - npm_arch : arm
35+ vscode_arch : armhf
4136 package_arch : armv7l
42- vscode_target : linux-armhf
4337
4438 env :
45- AR : ${{ format('{0}-ar', matrix.prefix) }}
46- AS : ${{ format('{0}-as', matrix.prefix) }}
47- CC : ${{ format('{0}-gcc', matrix.prefix) }}
48- CPP : ${{ format('{0}-cpp', matrix.prefix) }}
49- CXX : ${{ format('{0}-g++', matrix.prefix) }}
50- FC : ${{ format('{0}-gfortran', matrix.prefix) }}
51- LD : ${{ format('{0}-ld', matrix.prefix) }}
52- STRIP : ${{ format('{0}-strip', matrix.prefix) }}
53- PKG_CONFIG_PATH : ${{ format('/usr/lib/{0}/pkgconfig', matrix.prefix) }}
54- # Set cross-compiler package arch.
55- APT_ARCH : ${{ matrix.apt_arch }}
56- # For downloading the right Node.
57- npm_config_arch : ${{ matrix.npm_arch }}
58- # Overrides package architecture.
59- ARCH : ${{ matrix.package_arch }}
60- # Not building from source results in an x86_64 argon2, as if
61- # npm_config_arch is being ignored.
62- npm_config_build_from_source : true
63- # Overrides VS Code gulp build target.
64- VSCODE_TARGET : ${{ matrix.vscode_target }}
39+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40+ ELECTRON_SKIP_BINARY_DOWNLOAD : 1
41+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD : 1
6542 TAG : ${{ inputs.version || github.ref_name }}
43+ # Set release package name.
44+ ARCH : ${{ matrix.package_arch }}
45+ # Cross-compile target.
46+ VSCODE_ARCH : ${{ matrix.vscode_arch }}
47+ npm_config_arch : ${{ matrix.npm_arch }}
48+ # Gulp target name.
49+ VSCODE_TARGET : ${{ format('linux-{0}', matrix.vscode_arch) }}
6650
6751 steps :
68- - name : Install cross-compiler and system dependencies
69- run : |
70- sed -i 's/deb\.debian\.org/archive.debian.org/g' /etc/apt/sources.list
71- dpkg --add-architecture $APT_ARCH
72- apt update && apt install -y --no-install-recommends \
73- crossbuild-essential-$APT_ARCH \
74- libx11-dev:$APT_ARCH \
75- libx11-xcb-dev:$APT_ARCH \
76- libxkbfile-dev:$APT_ARCH \
77- libsecret-1-dev:$APT_ARCH \
78- libkrb5-dev:$APT_ARCH \
79- ca-certificates \
80- curl wget rsync gettext-base quilt git
52+ - run : sudo apt update && sudo apt install -y libkrb5-dev
53+ - uses : awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # latest
54+ with :
55+ packages : quilt
56+ version : 1.0
8157 - name : Install nfpm
8258 run : |
8359 mkdir -p ~/.local/bin
@@ -99,31 +75,35 @@ jobs:
9975 cache-dependency-path : |
10076 package-lock.json
10177 test/package-lock.json
102- - run : npm ci
103- - run : npm run build
104- - run : npm run build:vscode
78+
79+ - name : Build
80+ run : |
81+ cd lib/vscode/build
82+ npm ci
83+ cd ..
84+ source ./build/azure-pipelines/linux/setup-env.sh
85+ # Run preinstall script before root dependencies are installed
86+ # so that v8 headers are patched correctly for native modules.
87+ node build/npm/preinstall.ts
88+ cd ../..
89+ npm ci
90+ npm run build
91+ npm run build:vscode
10592
10693 # Platform-agnostic NPM package.
10794 - run : npm run release
108- if : ${{ matrix.vscode_target == 'linux- x64' }}
95+ if : ${{ matrix.vscode_arch == 'x64' }}
10996 - run : tar -czf package.tar.gz release
110- if : ${{ matrix.vscode_target == 'linux- x64' }}
97+ if : ${{ matrix.vscode_arch == 'x64' }}
11198 - uses : softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
112- if : ${{ matrix.vscode_target == 'linux- x64' }}
99+ if : ${{ matrix.vscode_arch == 'x64' }}
113100 with :
114101 draft : true
115102 discussion_category_name : " 📣 Announcements"
116103 files : package.tar.gz
117104
118105 # Platform-specific release.
119106 - run : KEEP_MODULES=1 npm run release
120- - name : Replace node with cross-compile equivalent
121- run : |
122- node_version=$(node --version)
123- wget https://nodejs.org/dist/${node_version}/node-${node_version}-linux-${npm_config_arch}.tar.xz
124- tar -xf node-${node_version}-linux-${npm_config_arch}.tar.xz node-${node_version}-linux-${npm_config_arch}/bin/node --strip-components=2
125- mv ./node ./release/lib/node
126-
127107 - run : npm run package
128108 - uses : softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
129109 with :
@@ -173,6 +153,7 @@ jobs:
173153 cache-dependency-path : |
174154 package-lock.json
175155 test/package-lock.json
156+
176157 - run : npm ci
177158 - run : npm run build
178159 - run : npm run build:vscode
0 commit comments