-
Notifications
You must be signed in to change notification settings - Fork 931
Set up extension build and sign pipeline #11504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adamint
merged 27 commits into
microsoft:main
from
adamint:dev/adamint/extension-loc-build-sign
Sep 23, 2025
Merged
Changes from 11 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
f0f1a7d
first try extension CI
adamint c4186d0
move above other stages
adamint 5740e21
install vsce globally before package
adamint 24c7c40
explicitly publish extension
adamint 17ee0bf
try add signing
adamint 8006a85
try #2
adamint 05676ac
Revert "try #2"
adamint e87d402
try to fix sign
adamint b6ed70e
try with artifacts packages dir property
adamint 17a2d4a
remove verification
adamint 671994f
clean up
adamint 106ed3a
pr suggestions
adamint fc2f4c1
run stages in parallel
adamint 131be2c
see if this runs in parallel
adamint 76a9e33
add restore back
adamint d6d73a3
rename binlog
adamint 13dfc8a
remove extra upload step
adamint 36c5577
Merge remote-tracking branch 'origin/main' into dev/adamint/extension…
radical e1cd165
Move building extension to msbuild from the scripts. And always build…
radical 4d1c4b5
fix typo
radical 33131d5
fix build
radical 98110e7
Don't try to parse errors and warnings from yarn/npm invocations. Onl…
radical ff14ebc
try publishing vsix
adamint a85e80c
update paths
adamint e178308
update paths 2
adamint c929b66
Revert "update paths 2"
adamint 5d72d08
fix path to publish..?
adamint File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| parameters: | ||
|
adamint marked this conversation as resolved.
Outdated
|
||
| - name: buildConfig | ||
| type: string | ||
| - name: repoArtifactsPath | ||
| type: string | ||
| - name: repoLogPath | ||
| type: string | ||
| - name: buildArgs | ||
| type: string | ||
| default: '' | ||
|
|
||
| steps: | ||
| - task: NodeTool@0 | ||
| displayName: 🟣Install node.js | ||
| inputs: | ||
| versionSpec: '20.x' | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: 🟣Install yarn | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| npm install -g yarn | ||
| yarn --version | ||
| workingDirectory: '$(Build.SourcesDirectory)' | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: 🟣Install vsce | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| npm install -g @vscode/vsce | ||
| vsce --version | ||
| workingDirectory: '$(Build.SourcesDirectory)' | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: 🟣Install dependencies and run localization | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| # Install dependencies | ||
| yarn install | ||
|
|
||
| # Compile | ||
| yarn compile | ||
|
|
||
| # Run localization | ||
| yarn ci-localize | ||
|
adamint marked this conversation as resolved.
Outdated
|
||
| workingDirectory: '$(Build.SourcesDirectory)/extension' | ||
| errorActionPreference: 'stop' | ||
| env: | ||
| YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: 🟣Package extension as VSIX | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| # Read version from package.json and package with pre-release flag | ||
| $packageJson = Get-Content 'package.json' | ConvertFrom-Json | ||
| $version = $packageJson.version | ||
| Write-Host "Packaging extension version: $version" | ||
|
|
||
| # Create artifacts directory if it doesn't exist - use same pattern as native build | ||
| $artifactsDir = "${{ parameters.repoArtifactsPath }}packages" | ||
| if (-not (Test-Path $artifactsDir)) { | ||
| New-Item -ItemType Directory -Path $artifactsDir -Force | ||
| } | ||
|
|
||
| # Package extension using locally installed vsce | ||
| $vsixFileName = "aspire-vscode-$version.vsix" | ||
| vsce package --pre-release --out "$artifactsDir/$vsixFileName" | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| throw "Extension packaging failed with exit code $LASTEXITCODE" | ||
| } | ||
|
|
||
| Write-Host "Extension packaged successfully to: $artifactsDir/$vsixFileName" | ||
|
adamint marked this conversation as resolved.
Outdated
|
||
| workingDirectory: '$(Build.SourcesDirectory)/extension' | ||
| errorActionPreference: 'stop' | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: 🟣List extension artifacts | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| $artifactsDir = "${{ parameters.repoArtifactsPath }}packages" | ||
| if (Test-Path $artifactsDir) { | ||
| Get-ChildItem -Path $artifactsDir -Filter "*.vsix" | ForEach-Object { | ||
| Write-Host "Found extension artifact: $($_.FullName) (Size: $([math]::Round($_.Length/1KB,2)) KB)" | ||
| } | ||
| } else { | ||
| Write-Host "Artifacts directory not found: $artifactsDir" | ||
| } | ||
|
|
||
| # Sign the extension if this is not a test build | ||
| - ${{ if ne(variables['_SignType'], 'test') }}: | ||
| - task: PowerShell@2 | ||
| displayName: 🟣Sign extension | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| Write-Host "=== Extension Signing Debug Info ===" | ||
| Write-Host "Sign type: $(_SignType)" | ||
| Write-Host "Team name: $(_TeamName)" | ||
| $artifactsDir = "${{ parameters.repoArtifactsPath }}packages" | ||
| Write-Host "Artifacts directory: $artifactsDir" | ||
|
|
||
| Write-Host "=== Starting signing process ===" | ||
| # Use the Arcade common build script with explicit ArtifactsPackagesDir to ensure signing finds the VSIX files | ||
| $buildCmd = "$(Build.SourcesDirectory)\eng\common\build.cmd" | ||
|
adamint marked this conversation as resolved.
Outdated
|
||
| $buildArgs = @( | ||
|
adamint marked this conversation as resolved.
Outdated
|
||
| "-ci" | ||
|
adamint marked this conversation as resolved.
Outdated
|
||
| "-restore" | ||
| "-sign" | ||
| "/p:DotNetSignType=$(_SignType)" | ||
| "/p:TeamName=$(_TeamName)" | ||
| "/p:Sign=true" | ||
| "/p:SignType=$(_SignType)" | ||
| "/p:ArtifactsPackagesDir=$artifactsDir\" | ||
| "/v:normal" | ||
| ) | ||
|
|
||
| Write-Host "Build command: $buildCmd" | ||
| Write-Host "Build args: $($buildArgs -join ' ')" | ||
|
|
||
| try { | ||
| & $buildCmd @buildArgs | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "Build.cmd failed with exit code: $LASTEXITCODE" | ||
| exit $LASTEXITCODE | ||
| } | ||
| Write-Host "Build.cmd completed successfully" | ||
| } | ||
| catch { | ||
| Write-Host "Error calling build.cmd: $_" | ||
| exit 1 | ||
| } | ||
|
|
||
| Write-Host "=== Signing completed, listing files after ===" | ||
| Get-ChildItem $artifactsDir -Filter "*.vsix" | ForEach-Object { | ||
| Write-Host " $($_.Name) - Size: $($_.Length) bytes - Modified: $($_.LastWriteTime)" | ||
| } | ||
| errorActionPreference: 'stop' | ||
| env: | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
| - task: 1ES.PublishBuildArtifacts@1 | ||
| displayName: 🟣Publish extension artifact | ||
| inputs: | ||
| PathtoPublish: '${{ parameters.repoArtifactsPath }}packages/' | ||
| ArtifactName: aspire-extension | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.