Skip to content

Commit db5da41

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/samples/electron-winml/fast-uri-3.1.2
2 parents cd517b5 + b393571 commit db5da41

22 files changed

Lines changed: 5109 additions & 505 deletions

.pipelines/release-vsc.yml

Lines changed: 90 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
trigger:
2+
batch: true
23
branches:
34
include:
45
- vsc-rel/v*
@@ -19,6 +20,10 @@ parameters:
1920
- name: SkipPublish
2021
displayName: Skip publishing to VS Code Marketplace
2122
type: boolean
23+
default: false
24+
- name: DoEsrp
25+
displayName: Sign the VSIX package (DoEsrp)
26+
type: boolean
2227
default: true
2328

2429
extends:
@@ -31,6 +36,8 @@ extends:
3136
os: windows
3237
stages:
3338
- stage: Build
39+
variables:
40+
- group: signingIdentity
3441
jobs:
3542
- job: Build
3643
pool:
@@ -44,58 +51,62 @@ extends:
4451
displayName: Setup Node.js 24
4552
inputs:
4653
version: '24.x'
54+
- ${{ if eq(parameters.DoEsrp, 'true') }}:
55+
- task: UseDotNet@2
56+
displayName: Setup .NET 8.0 (For ESRP Task)
57+
inputs:
58+
packageType: runtime
59+
version: 8.0.x
4760
- task: PowerShell@2
4861
displayName: Download public CLI release for VS Code extension
62+
env:
63+
GH_TOKEN: $(GITHUB_TOKEN)
4964
inputs:
5065
pwsh: true
66+
errorActionPreference: 'stop'
5167
targetType: 'inline'
5268
script: |
5369
$cliReleaseTag = "${{ parameters.CliReleaseTag }}"
5470
$repo = "microsoft/winappcli"
5571
5672
if ([string]::IsNullOrWhiteSpace($cliReleaseTag)) {
5773
Write-Host "No CLI release tag specified, finding latest stable release..."
58-
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/releases" -Headers @{ "User-Agent" = "AzurePipelines" }
59-
$stableRelease = $releases | Where-Object { -not $_.prerelease -and -not $_.draft } | Select-Object -First 1
74+
$releases = gh release list --repo $repo --limit 10 --json tagName,isPrerelease,isDraft | ConvertFrom-Json
75+
$stableRelease = $releases | Where-Object { -not $_.isPrerelease -and -not $_.isDraft } | Select-Object -First 1
6076
if (-not $stableRelease) {
6177
Write-Error "No stable release found for $repo"
6278
exit 1
6379
}
64-
$cliReleaseTag = $stableRelease.tag_name
80+
$cliReleaseTag = $stableRelease.tagName
6581
Write-Host "Found latest stable release: $cliReleaseTag"
6682
} else {
6783
Write-Host "Using specified CLI release tag: $cliReleaseTag"
6884
}
6985
7086
Write-Host "##vso[task.setvariable variable=CliReleaseTag]$cliReleaseTag"
7187
72-
# Download x64 and arm64 CLI zips
73-
$downloadBase = "https://github.com/$repo/releases/download/$cliReleaseTag"
88+
# Download x64 and arm64 CLI zips using gh CLI
7489
$cliDir = "$(System.DefaultWorkingDirectory)/artifacts/public-cli"
7590
7691
New-Item -ItemType Directory -Path "$cliDir/win-x64" -Force | Out-Null
7792
New-Item -ItemType Directory -Path "$cliDir/win-arm64" -Force | Out-Null
7893
79-
$x64Url = "$downloadBase/winappcli-x64.zip"
80-
$arm64Url = "$downloadBase/winappcli-arm64.zip"
81-
82-
Write-Host "Downloading x64 CLI from: $x64Url"
83-
Invoke-WebRequest -Uri $x64Url -OutFile "$cliDir/x64.zip"
84-
if ($LASTEXITCODE -ne 0 -or -not (Test-Path "$cliDir/x64.zip")) {
85-
Write-Error "Failed to download x64 CLI from $x64Url"
94+
Write-Host "Downloading CLI binaries from release $cliReleaseTag..."
95+
gh release download $cliReleaseTag --repo $repo --pattern "winappcli-x64.zip" --dir $cliDir
96+
if ($LASTEXITCODE -ne 0) {
97+
Write-Error "Failed to download winappcli-x64.zip from release $cliReleaseTag"
8698
exit 1
8799
}
88100
89-
Write-Host "Downloading arm64 CLI from: $arm64Url"
90-
Invoke-WebRequest -Uri $arm64Url -OutFile "$cliDir/arm64.zip"
91-
if ($LASTEXITCODE -ne 0 -or -not (Test-Path "$cliDir/arm64.zip")) {
92-
Write-Error "Failed to download arm64 CLI from $arm64Url"
101+
gh release download $cliReleaseTag --repo $repo --pattern "winappcli-arm64.zip" --dir $cliDir
102+
if ($LASTEXITCODE -ne 0) {
103+
Write-Error "Failed to download winappcli-arm64.zip from release $cliReleaseTag"
93104
exit 1
94105
}
95106
96107
# Extract
97-
Expand-Archive -Path "$cliDir/x64.zip" -DestinationPath "$cliDir/win-x64" -Force
98-
Expand-Archive -Path "$cliDir/arm64.zip" -DestinationPath "$cliDir/win-arm64" -Force
108+
Expand-Archive -Path "$cliDir/winappcli-x64.zip" -DestinationPath "$cliDir/win-x64" -Force
109+
Expand-Archive -Path "$cliDir/winappcli-arm64.zip" -DestinationPath "$cliDir/win-arm64" -Force
99110
100111
# Validate
101112
if (-not (Test-Path "$cliDir/win-x64/winapp.exe")) {
@@ -108,12 +119,58 @@ extends:
108119
}
109120
110121
Write-Host "CLI binaries ($cliReleaseTag) downloaded and validated successfully"
122+
- task: PowerShell@2
123+
displayName: Create temporary .npmrc for Build
124+
inputs:
125+
targetType: inline
126+
pwsh: true
127+
script: |
128+
$npmrcContent = "registry=https://pkgs.dev.azure.com/microsoft/pde-oss/_packaging/winapp-npm-feed/npm/registry/`nalways-auth=true"
129+
Set-Content -Path "$(System.DefaultWorkingDirectory)/src/winapp-VSC/.npmrc" -Value $npmrcContent
130+
Write-Host "Created .npmrc for Azure Artifacts feed in winapp-VSC directory"
131+
- task: npmAuthenticate@0
132+
displayName: Authenticate with Azure Artifacts feed
133+
inputs:
134+
workingFile: '$(System.DefaultWorkingDirectory)/src/winapp-VSC/.npmrc'
111135
- task: PowerShell@2
112136
displayName: Package VS Code extension with public CLI
113137
inputs:
114138
pwsh: true
115139
filePath: $(System.DefaultWorkingDirectory)\scripts\package-vsc.ps1
116140
arguments: "-Stable -CliBinariesPath '$(System.DefaultWorkingDirectory)/artifacts/public-cli'"
141+
- ${{ if eq(parameters.DoEsrp, 'true') }}:
142+
- task: EsrpCodeSigning@5
143+
displayName: Code Sign ESRP - VSIX Package
144+
inputs:
145+
ConnectedServiceName: $(SigningServiceName)
146+
AppRegistrationClientId: $(SigningAppId)
147+
AppRegistrationTenantId: $(SigningTenantId)
148+
AuthAKVName: $(SigningAKVName)
149+
AuthCertName: $(SigningAuthCertName)
150+
AuthSignCertName: $(SigningSignCertName)
151+
FolderPath: '$(System.DefaultWorkingDirectory)/artifacts/'
152+
Pattern: '*.vsix'
153+
UseMinimatch: true
154+
signConfigType: inlineSignParams
155+
inlineOperation: |
156+
[
157+
{
158+
"KeyCode": "CP-401405",
159+
"OperationCode": "OpcSign",
160+
"Parameters": {
161+
"FileDigest": "/fd SHA256"
162+
},
163+
"ToolName": "sign",
164+
"ToolVersion": "1.0"
165+
},
166+
{
167+
"KeyCode": "CP-401405",
168+
"OperationCode": "OpcVerify",
169+
"Parameters": {},
170+
"ToolName": "sign",
171+
"ToolVersion": "1.0"
172+
}
173+
]
117174
- task: CopyFiles@2
118175
displayName: Copy Artifacts - VS Code Extension
119176
inputs:
@@ -131,7 +188,7 @@ extends:
131188
dependsOn: Build
132189
condition: and(succeeded(), eq('${{ parameters.SkipPublish }}', 'false'))
133190
variables:
134-
- group: vsceMarketplaceIdentity
191+
- group: signingIdentity
135192
jobs:
136193
- job: publish_vsc_extension
137194
pool:
@@ -164,36 +221,21 @@ extends:
164221
displayName: Authenticate with Azure Artifacts feed
165222
inputs:
166223
workingFile: '.npmrc'
167-
- task: PowerShell@2
168-
displayName: "Publish to VS Code Marketplace"
169-
env:
170-
VSCE_PAT: $(VSCE_PAT)
224+
- task: AzureCLI@2
225+
displayName: Publish to VS Code Marketplace
171226
inputs:
172-
targetType: 'inline'
173-
errorActionPreference: 'stop'
174-
script: |
175-
Write-Host "Installing @vscode/vsce..."
176-
npm install @vscode/vsce
177-
if ($LASTEXITCODE -ne 0) {
178-
Write-Error "Failed to install @vscode/vsce"
179-
exit 1
180-
}
181-
182-
$vsix = Get-ChildItem "$(Pipeline.Workspace)/vscode-extension/" -Filter "*.vsix" | Select-Object -First 1
183-
if (-not $vsix) {
184-
Write-Error "No VSIX file found in vscode-extension artifact"
185-
exit 1
186-
}
187-
188-
$sizeMB = [math]::Round($vsix.Length / 1MB, 2)
189-
Write-Host "Publishing $($vsix.Name) ($sizeMB MB) to VS Code Marketplace..."
190-
191-
npx vsce publish --packagePath $vsix.FullName
192-
if ($LASTEXITCODE -ne 0) {
193-
Write-Error "Failed to publish to VS Code Marketplace"
227+
azureSubscription: $(SigningServiceName)
228+
scriptType: bash
229+
scriptLocation: inlineScript
230+
inlineScript: |
231+
npm install -g @vscode/vsce@3
232+
233+
VSIX=$(find "$(Pipeline.Workspace)/vscode-extension/" -name "*.vsix" | head -1)
234+
if [ -z "$VSIX" ]; then
235+
echo "##[error]No VSIX file found in vscode-extension artifact"
194236
exit 1
195-
}
196-
197-
Write-Host "Successfully published to VS Code Marketplace!"
237+
fi
198238
239+
echo "Publishing $VSIX to VS Code Marketplace..."
240+
vsce publish --packagePath "$VSIX" --azure-credential
199241

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Additional guides:
8383
| **Setup** | [init](usage.md#init), [restore](usage.md#restore), [update](usage.md#update) |
8484
| **Identity & Debugging** | [run](usage.md#run), [create-debug-identity](usage.md#create-debug-identity), [unregister](usage.md#unregister) |
8585
| **Packaging** | [pack](usage.md#pack) |
86-
| **Manifests** | [manifest generate](usage.md#manifest-generate), [manifest update-assets](usage.md#manifest), [manifest add-alias](usage.md#manifest-add-alias) |
86+
| **Manifests** | [manifest generate](usage.md#manifest-generate), [manifest update-assets](usage.md#manifest-update-assets), [manifest add-alias](usage.md#manifest-add-alias) |
8787
| **Certificates & Signing** | [cert generate](usage.md#cert-generate), [cert install](usage.md#cert-install), [sign](usage.md#sign), [create-external-catalog](usage.md#create-external-catalog) |
8888
| **Utilities** | [tool](usage.md#tool), [store](usage.md#store), [get-winapp-path](usage.md#get-winapp-path), [complete](usage.md#shell-completion) |
8989
| **UI Automation** | [ui](usage.md#ui) |

docs/guides/cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- mslearn: true -->
22
# Using winapp CLI with C++ and CMake
33

4-
This guide demonstrates how to use `winappcli` with a C++ application to debug with package identity and package your application as an MSIX.
4+
This guide demonstrates how to use the `winapp` CLI with a C++ application to debug with package identity and package your application as an MSIX.
55

66
Package identity is a core concept in the Windows app model. It allows your application to access specific Windows APIs (like Notifications, Security, AI APIs, etc), have a clean install/uninstall experience, and more.
77

docs/guides/dotnet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!-- mslearn: true -->
22
# Using winapp CLI with .NET
33

4-
> This guide should work for most .NET projects types. The steps have been tested with both console and UI-based projects like WPF. For working examples, check out the [dotnet-app](../../samples/dotnet-app) (console) and [wpf-app](../../samples/wpf-app) (WPF) samples in the samples folder.
4+
> This guide should work for most .NET project types. The steps have been tested with both console and UI-based projects like WPF. For working examples, check out the [dotnet-app](../../samples/dotnet-app) (console) and [wpf-app](../../samples/wpf-app) (WPF) samples in the samples folder.
55
6-
This guide demonstrates how to use `winappcli` with a .NET application to debug with package identity and package your application as an MSIX.
6+
This guide demonstrates how to use the `winapp` CLI with a .NET application to debug with package identity and package your application as an MSIX.
77

88
Package identity is a core concept in the Windows app model. It allows your application to access specific Windows APIs (like Notifications, Security, AI APIs, etc), have a clean install/uninstall experience, and more.
99

docs/guides/electron/cpp-notification-addon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npx winapp node create-addon
1717
```
1818

1919
> [!NOTE]
20-
> This command might prompt your to install Python or required Visual Studio tools if you don't already have them installed.
20+
> This command might prompt you to install Python or required Visual Studio tools if you don't already have them installed.
2121
2222
This creates a `nativeWindowsAddon/` folder with:
2323
- `nativeWindowsAddon.cc` - Your C++ code that will call Windows APIs

docs/guides/electron/packaging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The `--manifest` option is optional. If not provided, it will look for a Package
8686

8787
The `--cert` option is also optional. If not provided, the msix will not be signed.
8888

89-
The `--out` option is also optional. If not provided, the current directory will be used.
89+
The `--output` option is also optional. If not provided, the current directory will be used.
9090

9191
The MSIX package will be created as `./out/<your-app-name>.msix`.
9292

docs/guides/flutter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
For a complete working example, check out the [Flutter sample](../../samples/flutter-app) in this repository.
55

6-
This guide demonstrates how to use `winappcli` with a Flutter application to add package identity and package your app as an MSIX.
6+
This guide demonstrates how to use the `winapp` CLI with a Flutter application to add package identity and package your app as an MSIX.
77

88
Package identity is a core concept in the Windows app model. It allows your application to access specific Windows APIs (like Notifications, Security, AI APIs, etc), have a clean install/uninstall experience, and more.
99

docs/guides/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- mslearn: true -->
22
# Using winapp CLI with Rust
33

4-
This guide demonstrates how to use `winappcli` with a Rust application to debug with package identity and package your application as an MSIX.
4+
This guide demonstrates how to use the `winapp` CLI with a Rust application to debug with package identity and package your application as an MSIX.
55

66
For a complete working example, check out the [Rust sample](../../samples/rust-app) in this repository.
77

docs/guides/tauri.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- mslearn: true -->
22
# Using winapp CLI with Tauri
33

4-
This guide demonstrates how to use `winappcli` with a Tauri application to debug with package identity and package your application as an MSIX.
4+
This guide demonstrates how to use the `winapp` CLI with a Tauri application to debug with package identity and package your application as an MSIX.
55

66
Package identity is a core concept in the Windows app model. It allows your application to access specific Windows APIs (like Notifications, Security, AI APIs, etc), have a clean install/uninstall experience, and more.
77

0 commit comments

Comments
 (0)