浏览代码

ci(linux): install dependencies from devtool images [skip ci]

Baptiste Augrain 1 年之前
父节点
当前提交
0b4117ed49
共有 4 个文件被更改,包括 35 次插入22 次删除
  1. 9 2
      .github/workflows/insider-linux.yml
  2. 0 16
      patches/linux/yarn-arm.patch
  3. 22 0
      patches/linux/yarn-dependencies.patch
  4. 4 4
      prepare_vscode.sh

+ 9 - 2
.github/workflows/insider-linux.yml

@@ -42,8 +42,8 @@ jobs:
           npm_arch: arm64
           npm_arch: arm64
         - vscode_arch: armhf
         - vscode_arch: armhf
           npm_arch: arm
           npm_arch: arm
-        # - vscode_arch: ppc64le
-        #   npm_arch: ppc64
+        - vscode_arch: ppc64le
+          npm_arch: ppc64
     env:
     env:
       DISABLE_UPDATE: 'yes'
       DISABLE_UPDATE: 'yes'
       VSCODE_ARCH: ${{ matrix.vscode_arch }}
       VSCODE_ARCH: ${{ matrix.vscode_arch }}
@@ -118,6 +118,13 @@ jobs:
         run: ./update_version.sh
         run: ./update_version.sh
         if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
         if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
 
 
+      - name: Upload assets
+        uses: actions/upload-artifact@v4
+        with:
+          name: assets
+          path: assets/
+        if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
+
   aur:
   aur:
     needs:
     needs:
       - build
       - build

+ 0 - 16
patches/linux/yarn-arm.patch

@@ -1,16 +0,0 @@
-diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js
-index 72dd74f..e409a33 100644
---- a/build/npm/postinstall.js
-+++ b/build/npm/postinstall.js
-@@ -58,7 +58,7 @@ function yarnInstall(dir, opts) {
- 		}
--		if (process.env['npm_config_arch'] === 'arm') {
--			run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/home/builduser`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/home/builduser/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
--		} else {
-+		// if (process.env['npm_config_arch'] === 'arm') {
-+		// 	run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/home/builduser`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/home/builduser/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
-+		// } else {
- 			run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
--		}
-+		// }
- 		run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${dir}/node_modules`], opts);

+ 22 - 0
patches/linux/yarn-dependencies.patch

@@ -0,0 +1,22 @@
+diff --git a/build/npm/postinstall.js b/build/npm/postinstall.js
+index 72dd74f..0f70d8c 100644
+--- a/build/npm/postinstall.js
++++ b/build/npm/postinstall.js
+@@ -50,3 +50,3 @@ function yarnInstall(dir, opts) {
+ 
+-	if (process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'] && /^(.build\/distro\/npm\/)?remote$/.test(dir)) {
++	if (process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME']) {
+ 		const userinfo = os.userInfo();
+@@ -55,10 +55,6 @@ function yarnInstall(dir, opts) {
+ 		opts.cwd = root;
+-		if (process.env['npm_config_arch'] === 'arm64' || process.env['npm_config_arch'] === 'arm') {
++		if (process.env['npm_config_arch'] === 'arm64' || process.env['npm_config_arch'] === 'arm' || process.env['npm_config_arch'] === 'ppc64') {
+ 			run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts);
+ 		}
+-		if (process.env['npm_config_arch'] === 'arm') {
+-			run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/home/builduser`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/home/builduser/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
+-		} else {
+-			run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
+-		}
++		run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-e', 'npm_config_arch', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'yarn', '--cwd', dir, ...args], opts);
+ 		run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${dir}/node_modules`], opts);

+ 4 - 4
prepare_vscode.sh

@@ -95,12 +95,12 @@ if [[ "${OS_NAME}" == "linux" ]]; then
 
 
     if [[ "${VSCODE_ARCH}" == "x64" || "${VSCODE_ARCH}" == "arm64" ]]; then
     if [[ "${VSCODE_ARCH}" == "x64" || "${VSCODE_ARCH}" == "arm64" ]]; then
       VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME="vscodium/vscodium-linux-build-agent:centos7-devtoolset8-${VSCODE_ARCH}"
       VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME="vscodium/vscodium-linux-build-agent:centos7-devtoolset8-${VSCODE_ARCH}"
-
-      export VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME
-    elif [[ "${VSCODE_ARCH}" == "armhf" ]]; then
-      export VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME="vscodium/vscodium-linux-build-agent:bionic-armhf"
+    else
+      VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME="vscodium/vscodium-linux-build-agent:bionic-devtoolset-${VSCODE_ARCH}"
     fi
     fi
 
 
+    export VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME
+
     ./build/azure-pipelines/linux/install.sh
     ./build/azure-pipelines/linux/install.sh
 
 
     EXPECTED_GLIBC_VERSION="2.17" EXPECTED_GLIBCXX_VERSION="3.4.19" ./build/azure-pipelines/linux/verify-glibc-requirements.sh
     EXPECTED_GLIBC_VERSION="2.17" EXPECTED_GLIBCXX_VERSION="3.4.19" ./build/azure-pipelines/linux/verify-glibc-requirements.sh