From 7f73d3707c73a3e23bb2c24e4e8a8f41f9061457 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 14 Dec 2023 19:27:58 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20download=20pre-built=20esbuilt?= =?UTF-8?q?=20for=20apple=20silicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yaml | 16 +++++++++++++++- extensions/vscode/esbuild.js | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 847aaab0b..118c78f41 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -91,12 +91,26 @@ jobs: cd core npm ci --legacy-peer-deps - # 3. Run tests for the extension + # 2.5. Pre package and download anything that needs to be built on Apple Silicon - name: Prepare the extension run: | cd extensions/vscode npm run prepackage + - name: Download node_modules for esbuild on Apple Silicon + if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' + run: curl -o extensions/vscode/out/node_modules https://continue-server-binaries.s3.us-west-1.amazonaws.com/node_modules.zip + + - name: Unzip node_modules for esbuild on Apple Silicon + if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' + run: unzip extensions/vscode/out/node_modules + + - name: Remove node_modules.zip for esbuild on Apple Silicon + if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' + run: rm extensions/vscode/out/node_modules.zip + + # 3. Run tests for the extension + # - name: Install Xvfb for Linux and run tests # run: | # sudo apt-get install -y xvfb # Install Xvfb diff --git a/extensions/vscode/esbuild.js b/extensions/vscode/esbuild.js index 7b3f01df0..ada252280 100644 --- a/extensions/vscode/esbuild.js +++ b/extensions/vscode/esbuild.js @@ -18,6 +18,11 @@ const fs = require("fs"); }, }); + // Return instead of copying if on ARM Mac + if (process.platform === "darwin" && process.arch === "arm64") { + return; + } + fs.mkdirSync("out/node_modules", { recursive: true }); ncp.ncp("node_modules/esbuild", "out/node_modules/esbuild", function (err) {