diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 09bf14977..9a55526c2 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -91,31 +91,56 @@ jobs: cd core npm ci --legacy-peer-deps - # 2.5. Pre package and download anything that needs to be built on Apple Silicon + # 2.5. Pre package - name: Prepare the extension run: | cd extensions/vscode npm run prepackage + # 2.75. download anything that needs to be built on ARM (non-Windows) - name: Make the out directory - if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' + if: matrix.arch == 'arm64' run: | cd extensions/vscode mkdir out + cd out + mkdir node_modules - - 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.zip https://continue-server-binaries.s3.us-west-1.amazonaws.com/node_modules.zip + - name: Download esbuild on ARM + if: matrix.arch == 'arm64' + run: curl -o extensions/vscode/out/node_modules/@esbuild.zip https://continue-server-binaries.s3.us-west-1.amazonaws.com/${{ matrix.os }}/esbuild.zip - - name: Unzip node_modules for esbuild on Apple Silicon - if: matrix.os == 'macos-latest' && matrix.arch == 'arm64' + - name: Unzip esbuild on ARM + if: matrix.arch == 'arm64' run: | - cd extensions/vscode/out - unzip node_modules.zip + cd extensions/vscode/out/node_modules + ls + unzip @esbuild.zip - - 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 + - name: Remove esbuild.zip on ARM + if: matrix.arch == 'arm64' + run: rm extensions/vscode/out/node_modules/esbuild.zip + + # 2.875. download anything that needs to be built on ARM (Windows) + # - name: Make the out directory + # if: matrix.arch == 'arm64' + # run: | + # cd extensions\vscode + # mkdir out + + # - name: Download node_modules for esbuild on ARM + # if: matrix.arch == 'arm64' + # run: Invoke-WebRequest -Uri https://continue-server-binaries.s3.us-west-1.amazonaws.com/${{ matrix.os }}/node_modules.zip -OutFile extensions\vscode\out\node_modules.zip + + # - name: Unzip node_modules for esbuild on ARM + # if: matrix.arch == 'arm64' + # run: | + # cd extensions\vscode\out + # Expand-Archive -Path node_modules.zip -DestinationPath . + + # - name: Remove node_modules.zip for esbuild on ARM + # if: matrix.arch == 'arm64' + # run: Remove-Item extensions\vscode\out\node_modules.zip # 3. Run tests for the extension diff --git a/extensions/vscode/esbuild.js b/extensions/vscode/esbuild.js index ce9ec7137..bbdc18525 100644 --- a/extensions/vscode/esbuild.js +++ b/extensions/vscode/esbuild.js @@ -18,12 +18,6 @@ const fs = require("fs"); }, }); - // Return instead of copying if on ARM Mac - // This is an env var created in the GH Action - if (process.env.target === "darwin-arm64") { - return; - } - fs.mkdirSync("out/node_modules", { recursive: true }); ncp.ncp("node_modules/esbuild", "out/node_modules/esbuild", function (err) { @@ -32,6 +26,17 @@ const fs = require("fs"); } }); + // Return instead of copying if on ARM + // This is an env var created in the GH Action + // We will instead download the prebuilt binaries + if ( + process.env.target === "darwin-arm64" || + process.env.target === "linux-arm64" || + process.env.target === "win-arm64" + ) { + return; + } + ncp.ncp("node_modules/@esbuild", "out/node_modules/@esbuild", function (err) { if (err) { return console.error(err); diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 7ce9089fa..49474ce1c 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/icon.png", - "version": "0.9.5", + "version": "0.9.6", "repository": { "type": "git", "url": "https://github.com/continuedev/continue"