Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin committed Jan 28, 2025
1 parent 0398d61 commit 50ffe74
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
19 changes: 11 additions & 8 deletions eng/tsp-core/pipelines/jobs/build-standalone-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,27 @@ jobs:
hostArchitecture: ${{ parameters.hostArchitecture }}

steps:
- ${{ if eq(parameters.os, 'windows') }}:
- pwsh: |
Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/"
Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/x64/"
Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/"
Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
displayName: Check signtool is installed
- task: NodeTool@0
displayName: Install Node.js
retryCountOnTaskFailure: 3
inputs:
versionSpec: 22.x
- pwsh: |
Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/"
Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64"
$windowsSdkPath=Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/1*" | Select-Object FullName | Sort-Object -Descending { [version](Split-Path $_.FullName -leaf)} | Select-Object -first 1
$signtoolPath = "$($windowsSdkPath.FullName)\x64\signtool.exe"
echo "Sign tool path: $signtoolPath"
echo "##vso[task.setvariable variable=SIGNTOOL_PATH]$signtoolPath"
displayName: Find signtool path
- script: npm install -g pnpm
displayName: Install pnpm

- script: pnpm install --filter "@typespec/standalone-cli"
displayName: Install JavaScript Dependencies

- script: pnpm build
workingDirectory: packages/standalone
displayName: Build
Expand Down
6 changes: 5 additions & 1 deletion packages/standalone/scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as esbuild from "esbuild";
import { execa } from "execa";
import { execFileSync } from "node:child_process";
import { copyFile, mkdir } from "node:fs/promises";
import ora from "ora";
import { dirname, join } from "path";
Expand Down Expand Up @@ -53,7 +54,10 @@ async function createSea() {
if (process.platform === "darwin") {
execa`codesign --remove-signature ${exePath}`;
} else if (process.platform === "win32") {
execa`signtool remove /s ${exePath}`;
console.log("process.env.SIGNTOOL_PATH", process.env.SIGNTOOL_PATH);
if (process.env.SIGNTOOL_PATH) {
execFileSync(process.env.SIGNTOOL_PATH!, [`remove`, `/s`, exePath]);
}
}
});
await action(`Creating blob ${seaConfigPath}`, async () => {
Expand Down

0 comments on commit 50ffe74

Please sign in to comment.