Skip to content

Commit 939b5eb

Browse files
bschnurrCopilot
andauthored
Update azure-devdiv-pipeline.pre-release.yml for Azure Pipelines (#323)
* Update azure-devdiv-pipeline.pre-release.yml for Azure Pipelines fix pool name indent * try adding signing * update vsce * remove separate sign stage * change directories * add verify sigend vsix is different * make msbuild verbosity diagnostic * add a verification step * remove repacking * remove hash compare * check dist folder * fix -and * try to simplify * Revert "try to simplify" This reverts commit 82091fe. * lets output to just drop * refactor signing * try to simplify * update how signing * try to add actual publish * try to fix publish * just remove separate stage * split publsh into its own step * move installs to parent yml. move sign.proj to build folder * fix msbuild args. turn detailed back and and pass dir * nuget restore * remove nuget restore * update sign.proj * update nuget package paths * fix singature location * add stable pipeline * we need need a step to install vscode/vsce@latest because npm ci shoudl do that * use npx vsce * update to node 22 and turn on nightly, and enable actuall publish call, turn off previous pre-release * change step to copy vsix to drop. remove unused variables. * add build vsix * package script already triggered in svce package * create drop folder * add vsix name variable * add vsix name to stable * remove schedule * forgot --release on stable build number * publish stable on tag push * fix pretter. new command to run fix prettier * Update build/azure-devdiv-pipeline.stable.yml Co-authored-by: Copilot <[email protected]> * Update build/azure-devdiv-pipeline.stable.yml Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent f34bee2 commit 939b5eb

File tree

9 files changed

+1710
-324
lines changed

9 files changed

+1710
-324
lines changed

build/azure-devdiv-pipeline.pre-release.yml

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
trigger: none
33
pr: none
44

5-
# schedules:
6-
# - cron: '0 10 * * 1-5' # 10AM UTC (2AM PDT) MON-FRI (VS Code Pre-release builds at 9PM PDT)
7-
# displayName: Nightly Pre-Release Schedule
8-
# always: false # only run if there are source code changes
9-
# branches:
10-
# include:
11-
# - main
5+
schedules:
6+
- cron: '0 10 * * 1-5' # 10AM UTC (2AM PDT) MON-FRI (VS Code Pre-release builds at 9PM PDT)
7+
displayName: Nightly Pre-Release Schedule
8+
always: false # only run if there are source code changes
9+
branches:
10+
include:
11+
- main
1212

1313
resources:
1414
repositories:
@@ -17,11 +17,10 @@ resources:
1717
name: 1ESPipelineTemplates/MicroBuildTemplate
1818
ref: refs/tags/release
1919
variables:
20-
- name: SigningType
21-
value: 'real'
2220
- name: TeamName
2321
value: VSCode-autopep8
24-
22+
- name: VsixName
23+
value: autopep8.vsix
2524
parameters:
2625
- name: publishExtension
2726
displayName: 🚀 Publish Extension
@@ -33,10 +32,13 @@ extends:
3332
parameters:
3433
sdl:
3534
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
35+
codeSignValidation:
36+
enabled: true
37+
sbom:
38+
enabled: false # Disable global SBOM generation; we'll enable selectively per artifact output
3639
pool:
3740
name: AzurePipelines-EO
38-
image: 1ESPT-Ubuntu22.04
39-
os: linux
41+
os: windows
4042

4143
customBuildTags:
4244
- ES365AIMigrationTooling
@@ -47,14 +49,26 @@ extends:
4749
- job: Build
4850
displayName: Build Job
4951
pool:
50-
name: VSEngSS-MicroBuild2022-1ES # use windows for codesigning to make things easier https://dev.azure.com/devdiv/DevDiv/_wiki/wikis/DevDiv.wiki/650/MicroBuild-Signing
51-
os: windows
52+
name: VSEngSS-MicroBuild2022-1ES # use windows for codesigning to make things easier https://dev.azure.com/devdiv/DevDiv/_wiki/wikis/DevDiv.wiki/650/MicroBuild-Signing
53+
os: windows
54+
templateContext:
55+
mb:
56+
signing:
57+
enabled: true
58+
signType: real
59+
signWithProd: true
60+
outputs:
61+
- output: pipelineArtifact
62+
displayName: 'Publish Drop Artifact'
63+
targetPath: '$(Build.StagingDirectory)\drop'
64+
artifactName: drop
65+
sbomEnabled: true
5266
steps:
5367
- task: NodeTool@0
5468
inputs:
5569
versionSpec: '22.x'
56-
checkLatest: false
57-
displayName: Select Node version
70+
checkLatest: true
71+
displayName: Select Node 20 LTS
5872

5973
- task: UsePythonVersion@0
6074
inputs:
@@ -81,5 +95,29 @@ extends:
8195
- script: python ./build/update_ext_version.py --for-publishing
8296
displayName: Update build number
8397

84-
- script: npm run package
85-
displayName: Build extension
98+
- script: npm run vsce-package
99+
displayName: Build VSIX
100+
101+
- powershell: New-Item -ItemType Directory -Path "$(Build.StagingDirectory)\drop" -Force | Out-Null; Copy-Item "$(Build.SourcesDirectory)\$(VsixName)" "$(Build.StagingDirectory)\drop\$(VsixName)" -Force; if (!(Test-Path "$(Build.StagingDirectory)\drop\$(VsixName)")) { Write-Error 'VSIX copy failed'; exit 1 }; Get-Item "$(Build.StagingDirectory)\drop\$(VsixName)" | Format-Table Name,Length,LastWriteTime -AutoSize
102+
displayName: Copy VSIX into drop
103+
104+
- script: npx vsce generate-manifest -i "$(Build.StagingDirectory)\drop\$(VsixName)" -o "$(Build.StagingDirectory)\drop\extension.manifest"
105+
displayName: Generate extension manifest
106+
107+
- template: build/templates/sign.yml@self
108+
parameters:
109+
vsixName: $(VsixName)
110+
workingDirectory: $(Build.StagingDirectory)\drop
111+
signType: real
112+
verifySignature: true
113+
114+
- ${{ if eq(parameters.publishExtension, true) }}:
115+
- template: build/templates/publish.yml@self
116+
parameters:
117+
azureSubscription: PylancePublishPipelineSecureConnectionWithManagedIdentity
118+
vsixName: $(VsixName)
119+
manifestName: extension.manifest
120+
signatureName: extension.signature.p7s
121+
publishFolder: drop
122+
preRelease: true
123+
noVerify: true
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Publish Release
2+
trigger:
3+
branches:
4+
include:
5+
- refs/tags/*
6+
7+
resources:
8+
repositories:
9+
- repository: MicroBuildTemplate
10+
type: git
11+
name: 1ESPipelineTemplates/MicroBuildTemplate
12+
ref: refs/tags/release
13+
variables:
14+
- name: TeamName
15+
value: VSCode-autopep8
16+
- name: VsixName
17+
value: autopep8.vsix
18+
19+
parameters:
20+
- name: publishExtension
21+
displayName: 🚀 Publish Extension
22+
type: boolean
23+
default: false
24+
25+
extends:
26+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
27+
parameters:
28+
sdl:
29+
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
30+
codeSignValidation:
31+
enabled: true
32+
sbom:
33+
enabled: false # Disable global SBOM generation; we'll enable selectively per artifact output
34+
pool:
35+
name: AzurePipelines-EO
36+
os: windows
37+
38+
customBuildTags:
39+
- ES365AIMigrationTooling
40+
stages:
41+
- stage: Build
42+
displayName: Build & Package Extension
43+
jobs:
44+
- job: Build
45+
displayName: Build Job
46+
pool:
47+
name: VSEngSS-MicroBuild2022-1ES # use windows for codesigning to make things easier https://dev.azure.com/devdiv/DevDiv/_wiki/wikis/DevDiv.wiki/650/MicroBuild-Signing
48+
os: windows
49+
templateContext:
50+
mb:
51+
signing:
52+
enabled: true
53+
signType: real
54+
signWithProd: true
55+
outputs:
56+
- output: pipelineArtifact
57+
displayName: 'Publish Drop Artifact'
58+
targetPath: '$(Build.StagingDirectory)\drop'
59+
artifactName: drop
60+
sbomEnabled: true
61+
steps:
62+
- task: NodeTool@0
63+
inputs:
64+
versionSpec: '22.x'
65+
checkLatest: true
66+
displayName: Select Node 20 LTS
67+
- task: UsePythonVersion@0
68+
inputs:
69+
versionSpec: '3.13'
70+
addToPath: true
71+
architecture: 'x64'
72+
displayName: Select Python version
73+
74+
- script: npm ci
75+
displayName: Install NPM dependencies
76+
77+
- script: python -m pip install -U pip
78+
displayName: Upgrade pip
79+
80+
- script: python -m pip install wheel
81+
displayName: Install wheel
82+
83+
- script: python -m pip install nox
84+
displayName: Install nox
85+
86+
- script: python -m nox --session install_bundled_libs
87+
displayName: Install Python dependencies
88+
89+
- script: python ./build/update_ext_version.py --release --for-publishing
90+
displayName: Update build number
91+
92+
- script: npm run vsce-package
93+
displayName: Build extension
94+
95+
- powershell: |
96+
New-Item -ItemType Directory -Path "$(Build.StagingDirectory)\drop" -Force | Out-Null; Copy-Item "$(Build.SourcesDirectory)\$(VsixName)" "$(Build.StagingDirectory)\drop\$(VsixName)" -Force; if (!(Test-Path "$(Build.StagingDirectory)\drop\$(VsixName)")) { Write-Error 'VSIX copy failed'; exit 1 }; Get-Item "$(Build.StagingDirectory)\drop\$(VsixName)" | Format-Table Name,Length,LastWriteTime -AutoSize
97+
displayName: Copy VSIX into drop
98+
99+
- script: npx vsce generate-manifest -i "$(Build.StagingDirectory)\drop\$(VsixName)" -o "$(Build.StagingDirectory)\drop\extension.manifest"
100+
displayName: Generate extension manifest
101+
102+
- template: build/templates/sign.yml@self
103+
parameters:
104+
vsixName: $(VsixName)
105+
workingDirectory: $(Build.StagingDirectory)\drop
106+
signType: real
107+
verifySignature: true
108+
109+
- ${{ if eq(parameters.publishExtension, true) }}:
110+
- template: build/templates/publish.yml@self
111+
parameters:
112+
azureSubscription: PylancePublishPipelineSecureConnectionWithManagedIdentity
113+
vsixName: $(VsixName)
114+
manifestName: extension.manifest
115+
signatureName: extension.signature.p7s
116+
publishFolder: drop
117+
preRelease: false
118+
noVerify: true
119+

build/azure-pipeline.pre-release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
trigger: none
33
pr: none
44

5-
schedules:
6-
- cron: '0 10 * * 1-5' # 10AM UTC (2AM PDT) MON-FRI (VS Code Pre-release builds at 9PM PDT)
7-
displayName: Nightly Pre-Release Schedule
8-
always: false # only run if there are source code changes
9-
branches:
10-
include:
11-
- main
5+
# schedules:
6+
# - cron: '0 10 * * 1-5' # 10AM UTC (2AM PDT) MON-FRI (VS Code Pre-release builds at 9PM PDT)
7+
# displayName: Nightly Pre-Release Schedule
8+
# always: false # only run if there are source code changes
9+
# branches:
10+
# include:
11+
# - main
1212

1313
resources:
1414
repositories:

build/sign.proj

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project InitialTargets="SetSigningProperties" DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!-- Adjusted package path to parent directory since NuGet restore places packages at repository root -->
4+
<Import Project="..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" Condition="Exists('..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.props')" />
5+
6+
7+
<Target Name="SetSigningProperties">
8+
<PropertyGroup>
9+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10+
<!-- Emit signing outputs into BaseOutputDirectory; allow override from MSBuild /p:BaseOutputDirectory=... -->
11+
<BaseOutputDirectory Condition="'$(BaseOutputDirectory)' == ''">.\</BaseOutputDirectory>
12+
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
13+
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(BaseOutputDirectory)/intermediate</IntermediateOutputPath>
14+
<OutDir Condition="'$(OutDir)' == ''">$(BaseOutputDirectory)</OutDir>
15+
</PropertyGroup>
16+
</Target>
17+
18+
<!-- Reintroduced CopySignatureFile & CopyBackSignatureFile so signing flow is self-contained -->
19+
20+
<Target Name="CopySignatureFile" BeforeTargets="GetFilesToSign">
21+
<!-- Use manifest from OutDir (working directory passed via /p:OutDir) and ensure proper path joining with explicit backslash -->
22+
<Error Condition="!Exists('$(OutDir)\\extension.manifest')" Text="Manifest not found at $(OutDir)\\extension.manifest. Ensure manifest generation precedes signing." />
23+
<Copy SourceFiles="$(OutDir)\\extension.manifest" DestinationFiles="$(OutDir)\\extension.signature.p7s" SkipUnchangedFiles="true" />
24+
</Target>
25+
26+
<Target Name="CopyBackSignatureFile" AfterTargets="SignFiles">
27+
<Copy Condition="Exists('$(OutDir)extension.signature.p7s')" SourceFiles="$(OutDir)extension.signature.p7s" DestinationFiles="$(ProjectDir)extension.signature.p7s" />
28+
</Target>
29+
30+
31+
<!-- SignFiles now fails fast if MicroBuild signing targets are missing -->
32+
<Target Name="SignFiles">
33+
<Error Condition="!Exists('..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')" Text="MicroBuild signing targets missing. Run NuGet restore before invoking MSBuild (packages.config)." />
34+
<Message Condition="Exists('..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')" Text="MicroBuild signing targets detected; delegating signing to imported targets." Importance="high" />
35+
</Target>
36+
37+
38+
<Target Name="GetFilesToSign" BeforeTargets="SignFiles">
39+
<ItemGroup>
40+
<FilesToSign Include="$(OutDir)\\extension.signature.p7s">
41+
<Authenticode>VSCodePublisher</Authenticode>
42+
</FilesToSign>
43+
</ItemGroup>
44+
</Target>
45+
46+
<Target Name="Build" BeforeTargets="CopySignatureFile">
47+
<MakeDir Directories="$(OutDir)"/>
48+
</Target>
49+
50+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="Build">
51+
<PropertyGroup>
52+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
53+
</PropertyGroup>
54+
<Error Condition="!Exists('..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.props'))" />
55+
<Error Condition="!Exists('..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets'))" />
56+
</Target>
57+
58+
<Import Project="..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" Condition="Exists('..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')" />
59+
</Project>

0 commit comments

Comments
 (0)