Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ nodeLanguageServer/**
nodeLanguageServer.*/**
bin/**
build/**
packages.config
BuildOutput/**
coverage/**
data/**
Expand Down
11 changes: 11 additions & 0 deletions build/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="repositoryPath" value="NuGetPackages" />
</config>
<packageSources>
<!-- Limit to one feed per 1ES guidance -->
<clear />
<add key="VS-CoreXtFeeds" value="https://pkgs.dev.azure.com/devdiv/_packaging/VS-CoreXtFeeds/nuget/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
159 changes: 159 additions & 0 deletions build/azure-devdiv-pipeline.pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Run on a schedule
trigger: none
pr: none

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

resources:
repositories:
- repository: templates
type: github
name: microsoft/pylance-eng
ref: refs/heads/main
endpoint: Github-Pylance

variables:
- name: TeamName
value: vscode-python
- name: NodeVersion
value: '22.21.1'
- name: AZURE_ARTIFACTS_FEED
value: 'https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/Pylance_PublicPackages/npm/registry/'

parameters:
- name: publishExtension
displayName: 🚀 Publish Extension
type: boolean
default: false

- name: buildPlatforms
type: object
default:
- name: Linux
vsceTarget: web
- name: Linux
vsceTarget: linux-arm64
- name: Linux
vsceTarget: linux-armhf
- name: Linux
vsceTarget: linux-x64
- name: Linux
vsceTarget: alpine-arm64
- name: Linux
vsceTarget: alpine-x64
- name: MacOS
vsceTarget: darwin-arm64
- name: MacOS
vsceTarget: darwin-x64
- name: Windows
vsceTarget: win32-arm64
- name: Windows
vsceTarget: win32-x64

- name: buildSteps
type: stepList
default:
- task: UsePythonVersion@0
inputs:
# Python 3.10 is not cached on the hosted macOS image.
versionSpec: '3.11'
addToPath: true
architecture: 'x64'
displayName: Select Python version

- script: python -m pip install -U pip
displayName: Upgrade pip

- script: python -m pip install wheel==0.47.0 nox==2026.7.11
displayName: Install wheel and nox

- script: npm ci
displayName: Install NPM dependencies

- script: nox --session install_python_libs
displayName: Install Python extension dependencies

- script: python ./build/update_package_file.py
displayName: Update telemetry in package.json

- script: npm run addExtensionPackDependencies
displayName: Update optional extension dependencies

- script: npx gulp prePublishBundle
displayName: Build

- bash: |
mkdir -p $(Build.SourcesDirectory)/python-env-tools/bin
chmod +x $(Build.SourcesDirectory)/python-env-tools/bin
displayName: Make Directory for python-env-tool binary

- bash: |
if [ "$(vsceTarget)" == "win32-x64" ]; then
echo "##vso[task.setvariable variable=buildTarget]x86_64-pc-windows-msvc"
elif [ "$(vsceTarget)" == "win32-arm64" ]; then
echo "##vso[task.setvariable variable=buildTarget]aarch64-pc-windows-msvc"
elif [ "$(vsceTarget)" == "linux-x64" ]; then
echo "##vso[task.setvariable variable=buildTarget]x86_64-unknown-linux-musl"
elif [ "$(vsceTarget)" == "linux-arm64" ]; then
echo "##vso[task.setvariable variable=buildTarget]aarch64-unknown-linux-gnu"
elif [ "$(vsceTarget)" == "linux-armhf" ]; then
echo "##vso[task.setvariable variable=buildTarget]armv7-unknown-linux-gnueabihf"
elif [ "$(vsceTarget)" == "darwin-x64" ]; then
echo "##vso[task.setvariable variable=buildTarget]x86_64-apple-darwin"
elif [ "$(vsceTarget)" == "darwin-arm64" ]; then
echo "##vso[task.setvariable variable=buildTarget]aarch64-apple-darwin"
elif [ "$(vsceTarget)" == "alpine-x64" ]; then
echo "##vso[task.setvariable variable=buildTarget]x86_64-unknown-linux-musl"
elif [ "$(vsceTarget)" == "alpine-arm64" ]; then
echo "##vso[task.setvariable variable=buildTarget]aarch64-unknown-linux-gnu"
elif [ "$(vsceTarget)" == "web" ]; then
echo "##vso[task.setvariable variable=buildTarget]x86_64-unknown-linux-musl"
else
echo "##vso[task.setvariable variable=buildTarget]x86_64-unknown-linux-musl"
fi
displayName: Set buildTarget variable

- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: 'DevDiv'
definition: 28980 # python-environment-tools DevDiv pre-release
buildVersionToDownload: 'latestFromBranch'
branchName: 'refs/heads/main'
targetPath: '$(Build.SourcesDirectory)/python-env-tools/bin'
artifactName: 'bin-$(buildTarget)'
itemPattern: |
pet.exe
pet
ThirdPartyNotices.txt
displayName: Download python-environment-tools binary

- bash: |
ls -lf ./python-env-tools/bin
chmod +x ./python-env-tools/bin/pet*
ls -lf ./python-env-tools/bin
displayName: Set chmod for pet binary

- script: python -c "import shutil; shutil.rmtree('.nox', ignore_errors=True)"
displayName: Clean up Nox

extends:
template: azure-pipelines/extension/pre-release.yml@templates
parameters:
buildPlatforms: ${{ parameters.buildPlatforms }}
buildSteps: ${{ parameters.buildSteps }}
standardizedVersioning: true
customNPMRegistry: $(AZURE_ARTIFACTS_FEED)
nodeVersion: $(NodeVersion)
publishExtension: ${{ parameters.publishExtension }}
teamName: $(TeamName)
ghCreateTag: false
ghCreateRelease: false
ghReleaseAddChangeLog: false
sourceAnalysisPool: VSEng-MicroBuildVSStable
59 changes: 59 additions & 0 deletions build/sign.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project InitialTargets="SetSigningProperties" DefaultTargets="SignFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Adjusted package path to parent directory since NuGet restore places packages at repository root -->
<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')" />


<Target Name="SetSigningProperties">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<!-- Emit signing outputs into BaseOutputDirectory; allow override from MSBuild /p:BaseOutputDirectory=... -->
<BaseOutputDirectory Condition="'$(BaseOutputDirectory)' == ''">.\</BaseOutputDirectory>
<!-- These properties are required by MicroBuild, which only signs files that are under these paths -->
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(BaseOutputDirectory)/intermediate</IntermediateOutputPath>
<OutDir Condition="'$(OutDir)' == ''">$(BaseOutputDirectory)</OutDir>
</PropertyGroup>
</Target>

<!-- Reintroduced CopySignatureFile & CopyBackSignatureFile so signing flow is self-contained -->

<Target Name="CopySignatureFile" BeforeTargets="GetFilesToSign">
<!-- Use manifest from OutDir (working directory passed via /p:OutDir) and ensure proper path joining with explicit backslash -->
<Error Condition="!Exists('$(OutDir)\\extension.manifest')" Text="Manifest not found at $(OutDir)\\extension.manifest. Ensure manifest generation precedes signing." />
<Copy SourceFiles="$(OutDir)\\extension.manifest" DestinationFiles="$(OutDir)\\extension.signature.p7s" SkipUnchangedFiles="true" />
</Target>

<Target Name="CopyBackSignatureFile" AfterTargets="SignFiles">
<Copy Condition="Exists('$(OutDir)extension.signature.p7s')" SourceFiles="$(OutDir)extension.signature.p7s" DestinationFiles="$(ProjectDir)extension.signature.p7s" />
</Target>


<!-- SignFiles now fails fast if MicroBuild signing targets are missing -->
<Target Name="SignFiles">
<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)." />
<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" />
</Target>


<Target Name="GetFilesToSign" BeforeTargets="SignFiles">
<ItemGroup>
<FilesToSign Include="$(OutDir)\\extension.signature.p7s">
<Authenticode>VSCodePublisher</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>

<Target Name="Build" BeforeTargets="CopySignatureFile">
<MakeDir Directories="$(OutDir)"/>
</Target>

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="Build">
<PropertyGroup>
<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>
</PropertyGroup>
<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'))" />
<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'))" />
</Target>

<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')" />
</Project>
4 changes: 4 additions & 0 deletions packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VisualStudioEng.MicroBuild.Core" version="1.0.0" />
</packages>
Loading