|
| 1 | +name: Publish Release |
| 2 | +trigger: |
| 3 | + branches: |
| 4 | + include: |
| 5 | + - 'release/*' |
| 6 | +pr: none |
| 7 | + |
| 8 | +resources: |
| 9 | + repositories: |
| 10 | + - repository: MicroBuildTemplate |
| 11 | + type: git |
| 12 | + name: 1ESPipelineTemplates/MicroBuildTemplate |
| 13 | + ref: refs/tags/release |
| 14 | + |
| 15 | + - repository: templates |
| 16 | + type: git |
| 17 | + name: DevDiv/Pylance-Eng |
| 18 | + ref: refs/heads/main |
| 19 | + |
| 20 | +variables: |
| 21 | + - name: TeamName |
| 22 | + value: VSCode-python-environments |
| 23 | + - name: VsixName |
| 24 | + value: python-environments.vsix |
| 25 | + - name: NodeVersion |
| 26 | + value: '22.21.1' |
| 27 | + - name: AZURE_ARTIFACTS_FEED |
| 28 | + value: 'https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/Pylance_PublicPackages/npm/registry/' |
| 29 | + |
| 30 | +parameters: |
| 31 | + - name: publishExtension |
| 32 | + displayName: 🚀 Publish Extension |
| 33 | + type: boolean |
| 34 | + default: true |
| 35 | + |
| 36 | + - name: petBranch |
| 37 | + displayName: PET artifact branch |
| 38 | + type: string |
| 39 | + default: refs/heads/release/2026.12 |
| 40 | + |
| 41 | + - name: buildPlatforms |
| 42 | + type: object |
| 43 | + default: |
| 44 | + - name: Linux |
| 45 | + vsceTarget: web |
| 46 | + - name: Linux |
| 47 | + packageArch: arm64 |
| 48 | + vsceTarget: linux-arm64 |
| 49 | + - name: Linux |
| 50 | + packageArch: arm |
| 51 | + vsceTarget: linux-armhf |
| 52 | + - name: Linux |
| 53 | + packageArch: x64 |
| 54 | + vsceTarget: linux-x64 |
| 55 | + - name: Linux |
| 56 | + packageArch: arm64 |
| 57 | + vsceTarget: alpine-arm64 |
| 58 | + - name: Linux |
| 59 | + packageArch: x64 |
| 60 | + vsceTarget: alpine-x64 |
| 61 | + - name: MacOS |
| 62 | + packageArch: arm64 |
| 63 | + vsceTarget: darwin-arm64 |
| 64 | + - name: MacOS |
| 65 | + packageArch: x64 |
| 66 | + vsceTarget: darwin-x64 |
| 67 | + - name: Windows |
| 68 | + packageArch: arm |
| 69 | + vsceTarget: win32-arm64 |
| 70 | + - name: Windows |
| 71 | + packageArch: x64 |
| 72 | + vsceTarget: win32-x64 |
| 73 | + |
| 74 | + - name: buildSteps |
| 75 | + type: stepList |
| 76 | + default: |
| 77 | + - script: npm ci |
| 78 | + displayName: Install NPM dependencies |
| 79 | + |
| 80 | + - script: python ./build/update_package_json.py |
| 81 | + displayName: Update telemetry in package.json |
| 82 | + |
| 83 | + - script: python ./build/update_ext_version.py --release --for-publishing |
| 84 | + displayName: Update build number |
| 85 | + |
| 86 | + - bash: | |
| 87 | + mkdir -p $(Build.SourcesDirectory)/python-env-tools/bin |
| 88 | + chmod +x $(Build.SourcesDirectory)/python-env-tools/bin |
| 89 | + displayName: Make Directory for python-env-tool binary |
| 90 | +
|
| 91 | + - bash: | |
| 92 | + if [ "$(vsceTarget)" == "win32-x64" ]; then |
| 93 | + echo "##vso[task.setvariable variable=buildTarget]x86_64-pc-windows-msvc" |
| 94 | + elif [ "$(vsceTarget)" == "win32-arm64" ]; then |
| 95 | + echo "##vso[task.setvariable variable=buildTarget]aarch64-pc-windows-msvc" |
| 96 | + elif [ "$(vsceTarget)" == "linux-x64" ]; then |
| 97 | + echo "##vso[task.setvariable variable=buildTarget]x86_64-unknown-linux-musl" |
| 98 | + elif [ "$(vsceTarget)" == "linux-arm64" ]; then |
| 99 | + echo "##vso[task.setvariable variable=buildTarget]aarch64-unknown-linux-gnu" |
| 100 | + elif [ "$(vsceTarget)" == "linux-armhf" ]; then |
| 101 | + echo "##vso[task.setvariable variable=buildTarget]armv7-unknown-linux-gnueabihf" |
| 102 | + elif [ "$(vsceTarget)" == "darwin-x64" ]; then |
| 103 | + echo "##vso[task.setvariable variable=buildTarget]x86_64-apple-darwin" |
| 104 | + elif [ "$(vsceTarget)" == "darwin-arm64" ]; then |
| 105 | + echo "##vso[task.setvariable variable=buildTarget]aarch64-apple-darwin" |
| 106 | + elif [ "$(vsceTarget)" == "alpine-x64" ]; then |
| 107 | + echo "##vso[task.setvariable variable=buildTarget]x86_64-unknown-linux-musl" |
| 108 | + elif [ "$(vsceTarget)" == "alpine-arm64" ]; then |
| 109 | + echo "##vso[task.setvariable variable=buildTarget]aarch64-unknown-linux-gnu" |
| 110 | + elif [ "$(vsceTarget)" == "web" ]; then |
| 111 | + echo "##vso[task.setvariable variable=buildTarget]x86_64-unknown-linux-musl" |
| 112 | + else |
| 113 | + echo "##vso[task.setvariable variable=buildTarget]x86_64-unknown-linux-musl" |
| 114 | + fi |
| 115 | + displayName: Set buildTarget variable |
| 116 | +
|
| 117 | + - task: DownloadPipelineArtifact@2 |
| 118 | + inputs: |
| 119 | + buildType: specific |
| 120 | + project: Monaco |
| 121 | + definition: 593 |
| 122 | + buildVersionToDownload: latestFromBranch |
| 123 | + branchName: ${{ parameters.petBranch }} |
| 124 | + targetPath: $(Build.SourcesDirectory)/python-env-tools/bin |
| 125 | + artifactName: bin-$(buildTarget) |
| 126 | + itemPattern: | |
| 127 | + pet.exe |
| 128 | + pet |
| 129 | + ThirdPartyNotices.txt |
| 130 | +
|
| 131 | + - bash: | |
| 132 | + ls -lf ./python-env-tools/bin |
| 133 | + chmod +x ./python-env-tools/bin/pet* |
| 134 | + ls -lf ./python-env-tools/bin |
| 135 | + displayName: Set chmod for pet binary |
| 136 | +
|
| 137 | + - script: npm run package |
| 138 | + displayName: Build extension |
| 139 | + |
| 140 | +extends: |
| 141 | + template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate |
| 142 | + parameters: |
| 143 | + sdl: |
| 144 | + sourceAnalysisPool: VSEng-MicroBuildVSStable |
| 145 | + codeSignValidation: |
| 146 | + enabled: true |
| 147 | + sbom: |
| 148 | + enabled: false # Disable global SBOM generation; enable it on the signed artifact. |
| 149 | + pool: |
| 150 | + name: AzurePipelines-EO |
| 151 | + os: windows |
| 152 | + |
| 153 | + customBuildTags: |
| 154 | + - ES365AIMigrationTooling |
| 155 | + |
| 156 | + stages: |
| 157 | + - stage: Build |
| 158 | + displayName: Build & Package Extension |
| 159 | + jobs: |
| 160 | + - template: azure-pipelines/extension/templates/jobs/package.yml@templates |
| 161 | + parameters: |
| 162 | + buildPlatforms: ${{ parameters.buildPlatforms }} |
| 163 | + buildSteps: ${{ parameters.buildSteps }} |
| 164 | + isPreRelease: false |
| 165 | + standardizedVersioning: true |
| 166 | + customNPMRegistry: $(AZURE_ARTIFACTS_FEED) |
| 167 | + nodeVersion: $(NodeVersion) |
| 168 | + |
| 169 | + - stage: WaitForValidation |
| 170 | + displayName: Wait for Validation |
| 171 | + dependsOn: Build |
| 172 | + jobs: |
| 173 | + - job: wait_for_validation |
| 174 | + displayName: Wait for manual validation |
| 175 | + pool: server |
| 176 | + steps: |
| 177 | + - task: ManualValidation@0 |
| 178 | + timeoutInMinutes: 1440 # task times out in 1 day |
| 179 | + inputs: |
| 180 | + notifyUsers: 'plseng@microsoft.com' |
| 181 | + instructions: 'please test the latest draft release then publish it.' |
| 182 | + onTimeout: reject |
| 183 | + |
| 184 | + - stage: Publish |
| 185 | + displayName: Publish Extension |
| 186 | + dependsOn: WaitForValidation |
| 187 | + jobs: |
| 188 | + - template: azure-pipelines/extension/templates/jobs/publish-extension.yml@templates |
| 189 | + parameters: |
| 190 | + buildPlatforms: ${{ parameters.buildPlatforms }} |
| 191 | + publishExtension: ${{ parameters.publishExtension }} |
| 192 | + preRelease: false |
| 193 | + teamName: $(TeamName) |
| 194 | + ghCreateTag: true |
| 195 | + ghCreateRelease: true |
| 196 | + ghReleaseAddChangeLog: true |
| 197 | + customNPMRegistry: $(AZURE_ARTIFACTS_FEED) |
| 198 | + nodeVersion: $(NodeVersion) |
0 commit comments