|
1 | 1 | trigger: |
2 | 2 | - main |
3 | 3 |
|
4 | | -variables: |
5 | | - Codeql.Enabled: true |
| 4 | +extends: |
| 5 | + template: /eng/1es-redirect.yml |
| 6 | + parameters: |
| 7 | + stages: |
| 8 | + - stage: Build |
| 9 | + variables: |
| 10 | + - template: /eng/image.yml |
| 11 | + jobs: |
| 12 | + - job: Build_linux |
6 | 13 |
|
7 | | -strategy: |
8 | | - matrix: |
9 | | - Linux: |
10 | | - Pool: azsdk-pool-mms-ubuntu-2204-general |
11 | | - OsVmImage: ubuntu-22.04 |
12 | | - TargetFolder: drop-linux |
13 | | - Windows: |
14 | | - Pool: azsdk-pool-mms-win-2022-general |
15 | | - OsVmImage: windows-2022 |
16 | | - TargetFolder: drop |
| 14 | + pool: |
| 15 | + name: $(LINUXPOOL) |
| 16 | + image: $(LINUXVMIMAGE) |
| 17 | + os: linux |
17 | 18 |
|
18 | | -pool: |
19 | | - name: $(Pool) |
20 | | - vmImage: $(OSVmImage) |
| 19 | + steps: |
| 20 | + - template: /eng/test-steps.yml |
| 21 | + parameters: |
| 22 | + ArtifactName: drop-linux |
21 | 23 |
|
22 | | -steps: |
23 | | -- script: npm ci |
24 | | - displayName: npm ci |
25 | | -- script: npm run lint |
26 | | - displayName: lint |
27 | | -- script: npm run prettier |
28 | | - displayName: prettier |
29 | | -- script: npm test |
30 | | - displayName: test |
31 | | -- script: npm pack |
32 | | - displayName: pack |
33 | | -- task: CopyFiles@2 |
34 | | - displayName: 'Copy Files to: $(TargetFolder)' |
35 | | - inputs: |
36 | | - Contents: '*.tgz' |
37 | | - TargetFolder: $(TargetFolder) |
38 | | -- task: PublishBuildArtifacts@1 |
39 | | - inputs: |
40 | | - pathtoPublish: $(Build.SourcesDirectory)/$(TargetFolder) |
41 | | - artifactName: $(TargetFolder) |
| 24 | + - job: Build_Windows |
42 | 25 |
|
43 | | -- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2 # CredScan@2 |
44 | | - inputs: |
45 | | - toolMajorVersion: 'V2' |
46 | | - condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT')) # CredScan only supported on Windows |
| 26 | + pool: |
| 27 | + name: $(WINDOWSPOOL) |
| 28 | + image: $(WINDOWSVMIMAGE) |
| 29 | + os: windows |
47 | 30 |
|
48 | | -- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1 # PostAnalysis@1 |
49 | | - inputs: |
50 | | - AllTools: false |
51 | | - APIScan: false |
52 | | - BinSkim: false |
53 | | - CodesignValidation: false |
54 | | - CredScan: true |
55 | | - FortifySCA: false |
56 | | - FxCop: false |
57 | | - ModernCop: false |
58 | | - PoliCheck: false |
59 | | - RoslynAnalyzers: false |
60 | | - SDLNativeRules: false |
61 | | - Semmle: false |
62 | | - TSLint: false |
63 | | - ToolLogsNotFoundAction: 'Standard' |
64 | | - condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT')) # CredScan only supported on Windows |
| 31 | + steps: |
| 32 | + - template: /eng/test-steps.yml |
| 33 | + parameters: |
| 34 | + ArtifactName: drop |
| 35 | + |
| 36 | + |
| 37 | + # only include if running on `internal` build with manual queue, otherwise never include |
| 38 | + - ${{ if and(in(variables['Build.Reason'], 'Manual', ''), eq(variables['System.TeamProject'], 'internal'))}}: |
| 39 | + - stage: Publish |
| 40 | + displayName: Publish |
| 41 | + dependsOn: Build_And_Test |
| 42 | + |
| 43 | + jobs: |
| 44 | + - deployment: Publish |
| 45 | + environment: 'package-publish' |
| 46 | + pool: |
| 47 | + name: azsdk-pool-mms-ubuntu-2004-general |
| 48 | + image: azsdk-pool-mms-ubuntu-2004-1espt |
| 49 | + os: linux |
| 50 | + |
| 51 | + strategy: |
| 52 | + runOnce: |
| 53 | + deploy: |
| 54 | + steps: |
| 55 | + - checkout: self |
| 56 | + submodules: false |
| 57 | + |
| 58 | + - download: current |
| 59 | + artifact: drop |
| 60 | + timeoutInMinutes: 5 |
| 61 | + |
| 62 | + - task: PowerShell@2 |
| 63 | + inputs: |
| 64 | + filePath: '$(Build.SourcesDirectory)/eng/scripts/determine-release-tag.ps1' |
| 65 | + failOnStderr: true |
| 66 | + pwsh: true |
| 67 | + |
| 68 | + - pwsh: | |
| 69 | + Write-Host "Will deploy with tag of $(Tag)" |
| 70 | + Get-ChildItem "$(Pipeline.Workspace)/drop" -Recurse -Force ` |
| 71 | + | Where-Object { $_.Name -like "*.tgz" } ` |
| 72 | + | Copy-Item -Destination "$(Build.ArtifactStagingDirectory)" |
| 73 | +
|
| 74 | + Get-ChildItem "$(Build.ArtifactStagingDirectory)" -Recurse -Force | % { Write-Host $_.FullName } |
| 75 | + displayName: Move artifact to $(Build.ArtifactStagingDirectory) |
| 76 | +
|
| 77 | + - task: EsrpRelease@7 |
| 78 | + inputs: |
| 79 | + displayName: 'Publish oav to ESRP' |
| 80 | + ConnectedServiceName: 'Azure SDK Engineering System' |
| 81 | + ClientId: '5f81938c-2544-4f1f-9251-dd9de5b8a81b' |
| 82 | + KeyVaultName: 'AzureSDKEngKeyVault' |
| 83 | + AuthCertName: 'azure-sdk-esrp-release-auth-certificate' |
| 84 | + SignCertName: 'azure-sdk-esrp-release-sign-certificate' |
| 85 | + Intent: 'PackageDistribution' |
| 86 | + ContentType: 'npm' |
| 87 | + FolderLocation: $(Build.ArtifactStagingDirectory) |
| 88 | + Owners: ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }} |
| 89 | + Approvers: 'azuresdk@microsoft.com' |
| 90 | + ServiceEndpointUrl: 'https://api.esrp.microsoft.com' |
| 91 | + MainPublisher: 'ESRPRELPACMANTEST' |
| 92 | + DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' |
| 93 | + productstate: $(Tag) |
0 commit comments