|
| 1 | +# Run on a schedule |
| 2 | +trigger: none |
| 3 | +pr: none |
| 4 | + |
| 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 |
| 12 | + |
| 13 | +resources: |
| 14 | + repositories: |
| 15 | + - repository: MicroBuildTemplate |
| 16 | + type: git |
| 17 | + name: 1ESPipelineTemplates/MicroBuildTemplate |
| 18 | + ref: refs/tags/release |
| 19 | +variables: |
| 20 | + - name: TeamName |
| 21 | + value: VSCode-black-formatter |
| 22 | + - name: VsixName |
| 23 | + value: black-formatter.vsix |
| 24 | + - name: AZURE_ARTIFACTS_FEED |
| 25 | + value: 'https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/Pylance_PublicPackages/npm/registry/' |
| 26 | +parameters: |
| 27 | + - name: publishExtension |
| 28 | + displayName: 🚀 Publish Extension |
| 29 | + type: boolean |
| 30 | + default: false |
| 31 | + |
| 32 | +extends: |
| 33 | + template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate |
| 34 | + parameters: |
| 35 | + sdl: |
| 36 | + sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES |
| 37 | + codeSignValidation: |
| 38 | + enabled: true |
| 39 | + sbom: |
| 40 | + enabled: false # Disable global SBOM generation; we'll enable selectively per artifact output |
| 41 | + pool: |
| 42 | + name: AzurePipelines-EO |
| 43 | + os: windows |
| 44 | + |
| 45 | + customBuildTags: |
| 46 | + - ES365AIMigrationTooling |
| 47 | + stages: |
| 48 | + - stage: Build |
| 49 | + displayName: Build & Package Extension |
| 50 | + jobs: |
| 51 | + - job: Build |
| 52 | + displayName: Build Job |
| 53 | + pool: |
| 54 | + 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 |
| 55 | + os: windows |
| 56 | + templateContext: |
| 57 | + mb: |
| 58 | + signing: |
| 59 | + enabled: true |
| 60 | + signType: real |
| 61 | + signWithProd: true |
| 62 | + outputs: |
| 63 | + - output: pipelineArtifact |
| 64 | + displayName: 'Publish Drop Artifact' |
| 65 | + targetPath: '$(Build.StagingDirectory)\drop' |
| 66 | + artifactName: drop |
| 67 | + sbomEnabled: true |
| 68 | + steps: |
| 69 | + - task: npmAuthenticate@0 |
| 70 | + inputs: |
| 71 | + workingFile: .npmrc |
| 72 | + |
| 73 | + - script: npm config get registry |
| 74 | + displayName: Verify NPM Registry |
| 75 | + |
| 76 | + - task: NodeTool@0 |
| 77 | + inputs: |
| 78 | + versionSpec: '22.17.0' |
| 79 | + checkLatest: true |
| 80 | + displayName: Select Node 22 LTS |
| 81 | + |
| 82 | + - task: UsePythonVersion@0 |
| 83 | + inputs: |
| 84 | + versionSpec: '3.9' # note Install Python dependencies step below relies on Python 3.9 |
| 85 | + addToPath: true |
| 86 | + architecture: 'x64' |
| 87 | + displayName: Select Python version |
| 88 | + |
| 89 | + - script: npm ci |
| 90 | + displayName: Install NPM dependencies |
| 91 | + |
| 92 | + - script: python -m pip install -U pip |
| 93 | + displayName: Upgrade pip |
| 94 | + |
| 95 | + - script: python -m pip install wheel |
| 96 | + displayName: Install wheel |
| 97 | + |
| 98 | + - script: python -m pip install nox |
| 99 | + displayName: Install nox |
| 100 | + |
| 101 | + - script: python -m nox --session install_bundled_libs |
| 102 | + displayName: Install Python dependencies |
| 103 | + |
| 104 | + - script: python ./build/update_ext_version.py --for-publishing |
| 105 | + displayName: Update build number |
| 106 | + |
| 107 | + - script: npm run vsce-package-pre |
| 108 | + displayName: Build VSIX |
| 109 | + |
| 110 | + - template: build/templates/sign.yml@self |
| 111 | + parameters: |
| 112 | + vsixName: $(VsixName) |
| 113 | + workingDirectory: $(Build.StagingDirectory)\drop |
| 114 | + signType: real |
| 115 | + verifySignature: true |
| 116 | + teamName: $(TeamName) |
| 117 | + |
| 118 | + - ${{ if eq(parameters.publishExtension, true) }}: |
| 119 | + - template: build/templates/publish.yml@self |
| 120 | + parameters: |
| 121 | + azureSubscription: PylancePublishPipelineSecureConnectionWithManagedIdentity |
| 122 | + vsixName: $(VsixName) |
| 123 | + manifestName: extension.manifest |
| 124 | + signatureName: extension.signature.p7s |
| 125 | + publishFolder: drop |
| 126 | + preRelease: true |
0 commit comments