Skip to content

Commit 2d6ce26

Browse files
author
ladeak
committed
arm64 builds for VSC extension
1 parent d33289e commit 2d6ce26

10 files changed

Lines changed: 128 additions & 30 deletions

File tree

.github/workflows/CD.yml

Lines changed: 108 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,17 @@ jobs:
9292
- name: Build VSCodeExtension dependencies
9393
run: |
9494
dotnet publish src/CHttpExtension -r linux-x64 -f net9.0 # .NET 9
95-
- name: Upload CHttpExtension file to artifacts
95+
dotnet publish src/CHttpExtension -r linux-arm64 -f net9.0 # .NET 9
96+
- name: Upload CHttpExtension file to artifacts (linux-x64)
9697
uses: actions/upload-artifact@v4
9798
with:
98-
name: CHttpExtension-Linux # The name of the artifact bundle
99+
name: CHttpExtension-linux-x64 # The name of the artifact bundle
99100
path: src/CHttpExtension/bin/Release/net9.0/linux-x64/publish/*
101+
- name: Upload CHttpExtension file to artifacts (linux-arm64)
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: CHttpExtension-linux-arm64 # The name of the artifact bundle
105+
path: src/CHttpExtension/bin/Release/net9.0/linux-arm64/publish/*
100106

101107
cross-compile-windows-aot:
102108
runs-on: windows-latest
@@ -126,15 +132,21 @@ jobs:
126132
- name: Build VSCodeExtension dependencies
127133
run: |
128134
dotnet publish src/CHttpExtension -r win-x64 -f net9.0 # .NET 9
129-
- name: Upload CHttpExtension file to artifacts
135+
dotnet publish src/CHttpExtension -r win-arm64 -f net9.0 # .NET 9
136+
- name: Upload CHttpExtension file to artifacts (win-x64)
130137
uses: actions/upload-artifact@v4
131138
with:
132-
name: CHttpExtension-Windows # The name of the artifact bundle
139+
name: CHttpExtension-win-x64 # The name of the artifact bundle
133140
path: src/CHttpExtension/bin/Release/net9.0/win-x64/publish/*
141+
- name: Upload CHttpExtension file to artifacts (win-arm64)
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: CHttpExtension-win-arm64 # The name of the artifact bundle
145+
path: src/CHttpExtension/bin/Release/net9.0/win-arm64/publish/*
134146

135-
build-and-deploy-vscodeextension:
147+
vscodeextension-linux-x64:
136148
runs-on: ubuntu-latest
137-
needs: [cross-compile-windows-aot, build-and-deploy]
149+
needs: [build-and-deploy]
138150
permissions:
139151
contents: write
140152
steps:
@@ -145,26 +157,109 @@ jobs:
145157
node-version: 26.x
146158
- name: Set VERSION variable from tag
147159
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
148-
- name: Download Platform Specific Artifacts - Linux
160+
- name: Download Platform Specific Artifacts (linux-x64)
149161
uses: actions/download-artifact@v4
150162
with:
151-
name: CHttpExtension-Linux
163+
name: CHttpExtension-linux-x64
152164
path: src/VSCodeExt/src/chttp-linux-x64
153-
- name: Download Platform Specific Artifacts - Windows
165+
- name: Publish VSCE
166+
run: |
167+
pushd ./src/VSCodeExt/
168+
npm install
169+
npm run vsce-deploy-linux-x64 ${VERSION}
170+
popd
171+
- name: Release
172+
uses: softprops/action-gh-release@v3
173+
with:
174+
files: |
175+
src/VSCodeExt/chttp-linux-x64.vsix
176+
177+
vscodeextension-linux-arm64:
178+
runs-on: ubuntu-latest
179+
needs: [build-and-deploy]
180+
permissions:
181+
contents: write
182+
steps:
183+
- uses: actions/checkout@v6
184+
- name: Install Node.js
185+
uses: actions/setup-node@v6
186+
with:
187+
node-version: 26.x
188+
- name: Set VERSION variable from tag
189+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
190+
- name: Download Platform Specific Artifacts (linux-arm64)
154191
uses: actions/download-artifact@v4
155192
with:
156-
name: CHttpExtension-Windows
193+
name: CHttpExtension-linux-arm64
194+
path: src/VSCodeExt/src/chttp-linux-arm64
195+
- name: Publish VSCE
196+
run: |
197+
pushd ./src/VSCodeExt/
198+
npm install
199+
npm run vsce-deploy-linux-arm64 ${VERSION}
200+
popd
201+
- name: Release
202+
uses: softprops/action-gh-release@v3
203+
with:
204+
files: |
205+
src/VSCodeExt/chttp-linux-arm64.vsix
206+
207+
vscodeextension-win-x64:
208+
runs-on: ubuntu-latest
209+
needs: [cross-compile-windows-aot]
210+
permissions:
211+
contents: write
212+
steps:
213+
- uses: actions/checkout@v6
214+
- name: Install Node.js
215+
uses: actions/setup-node@v6
216+
with:
217+
node-version: 26.x
218+
- name: Set VERSION variable from tag
219+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
220+
- name: Download Platform Specific Artifacts (win-x64)
221+
uses: actions/download-artifact@v4
222+
with:
223+
name: CHttpExtension-win-x64
157224
path: src/VSCodeExt/src/chttp-win32-x64
158225
- name: Publish VSCE
159226
run: |
160227
pushd ./src/VSCodeExt/
161228
npm install
162-
npm run vsce-deploy-win ${VERSION}
163-
npm run vsce-deploy-linux ${VERSION}
229+
npm run vsce-deploy-win-x64 ${VERSION}
164230
popd
165231
- name: Release
166232
uses: softprops/action-gh-release@v3
167233
with:
168234
files: |
169235
src/VSCodeExt/chttp-win-x64.vsix
170-
src/VSCodeExt/chttp-linux-x64.vsix
236+
237+
vscodeextension-win-arm64:
238+
runs-on: ubuntu-latest
239+
needs: [cross-compile-windows-aot]
240+
permissions:
241+
contents: write
242+
steps:
243+
- uses: actions/checkout@v6
244+
- name: Install Node.js
245+
uses: actions/setup-node@v6
246+
with:
247+
node-version: 26.x
248+
- name: Set VERSION variable from tag
249+
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
250+
- name: Download Platform Specific Artifacts (win-arm64)
251+
uses: actions/download-artifact@v4
252+
with:
253+
name: CHttpExtension-win-arm64
254+
path: src/VSCodeExt/src/chttp-win32-arm64
255+
- name: Publish VSCE
256+
run: |
257+
pushd ./src/VSCodeExt/
258+
npm install
259+
npm run vsce-deploy-win-arm64 ${VERSION}
260+
popd
261+
- name: Release
262+
uses: softprops/action-gh-release@v3
263+
with:
264+
files: |
265+
src/VSCodeExt/chttp-win-arm64.vsix

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ jobs:
3838
run: |
3939
pushd ./src/VSCodeExt/
4040
npm install
41-
npm run vsce-deploy-win
42-
npm run vsce-deploy-linux
41+
npm run vsce-deploy-win-x64
42+
npm run vsce-deploy-linux-x64
4343
popd

src/VSCodeExt/dist/extension.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VSCodeExt/dist/extension.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VSCodeExt/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@
6767
"pretest": "npm run compile-tests && npm run compile && npm run lint",
6868
"lint": "eslint src --ext ts",
6969
"test": "node ./out/test/runTest.js",
70-
"vsce-deploy-win": "vsce package -o chttp-win-x64.vsix --target win32-x64",
71-
"vsce-deploy-linux": "vsce package -o chttp-linux-x64.vsix --target linux-x64",
70+
"vsce-deploy-win-x64": "vsce package -o chttp-win-x64.vsix --target win32-x64",
71+
"vsce-deploy-linux-x64": "vsce package -o chttp-linux-x64.vsix --target linux-x64",
72+
"vsce-deploy-win-arm64": "vsce package -o chttp-win-arm64.vsix --target win32-arm64",
73+
"vsce-deploy-linux-arm64": "vsce package -o chttp-linux-arm64.vsix --target linux-arm64",
7274
"vsce-publish": "vsce publish"
7375
},
7476
"devDependencies": {
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

src/VSCodeExt/src/controllers/diffController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class DiffController {
5353
return;
5454
}
5555
try {
56-
const CHttpModule = require(`../chttp-${os.platform()}-x64/CHttpExtension.node`);
56+
const CHttpModule = require(`../chttp-${os.platform()}-${os.arch()}/CHttpExtension.node`);
5757
var response = await CHttpModule.CHttpExt.getDiffAsync(diffRequest.file1, diffRequest.file2);
5858
this._view.render(response);
5959
this._requestStatusEntry.updateStatus("Completed");

src/VSCodeExt/src/controllers/requestController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class RequestController {
6565
token.onCancellationRequested(() => {
6666
CHttpModule.CHttpExt.cancel();
6767
});
68-
const CHttpModule = require(`../chttp-${os.platform()}-x64/CHttpExtension.node`);
68+
const CHttpModule = require(`../chttp-${os.platform()}-${os.arch()}/CHttpExtension.node`);
6969
var response = await CHttpModule.CHttpExt.perfMeasureAsync(
7070
name ? name : null,
7171
!metadatas.has(RequestMetadata.NoRedirect),
@@ -109,7 +109,7 @@ export class RequestController {
109109
const httpRequest = await parser.parseHttpRequest(name);
110110

111111
try {
112-
const CHttpModule = require(`../chttp-${os.platform()}-x64/CHttpExtension.node`);
112+
const CHttpModule = require(`../chttp-${os.platform()}-${os.arch()}/CHttpExtension.node`);
113113
var response = await CHttpModule.CHttpExt.sendRequestAsync(
114114
!metadatas.has(RequestMetadata.NoRedirect),
115115
!metadatas.has(RequestMetadata.NoCertificateValidation),

src/VSCodeExt/src/extension.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export function activate(context: vscode.ExtensionContext) {
1313
let sendRequest = vscode.commands.registerCommand('LaDeak-CHttp.sendRequest', ((document: TextDocument, range: Range) => requestController.run(range)));
1414
let cancelRequest = vscode.commands.registerCommand('LaDeak-CHttp.cancelRequest', ((document: TextDocument, range: Range) =>
1515
{
16-
const cHttpModule = require(`./chttp-${os.platform()}-x64/CHttpExtension.node`);
16+
17+
const cHttpModule = require(`./chttp-${os.platform()}-${os.arch()}/CHttpExtension.node`);
1718
cHttpModule.CHttpExt.cancel();
1819
}));
1920
let diff = vscode.commands.registerCommand('LaDeak-CHttp.diff', ((document: TextDocument, range: Range) => diffController.run(range)));
@@ -27,7 +28,7 @@ export function activate(context: vscode.ExtensionContext) {
2728
context.subscriptions.push(sendRequest);
2829
context.subscriptions.push(cancelRequest);
2930
context.subscriptions.push(diff);
30-
const cHttpModule = require(`./chttp-${os.platform()}-x64/CHttpExtension.node`);
31+
const cHttpModule = require(`./chttp-${os.platform()}-${os.arch()}/CHttpExtension.node`);
3132
cHttpModule.CHttpExt.setMsQuicPath(context.extensionPath);
3233
}
3334

0 commit comments

Comments
 (0)