Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added azure-pipelines/build.yml #150

Merged
merged 6 commits into from
Feb 15, 2024
Merged
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
139 changes: 139 additions & 0 deletions azure-pipelines/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: BuildParameters.vsVersion
value: 17.0
- name: Build.OfficialRelease
value: false
- name: Codeql.Enabled
value: true
- name: SignType
${{ if ne( variables['Build.Reason'], 'PullRequest' ) }}:
value: real
${{ else }}:
value: test
- name: TeamName
value: vscx-tools-authoring
- name: TimestampPackage
value: true
trigger:
branches:
include:
- refs/heads/master
resources:
repositories:
- repository: MicroBuildTemplate
type: git
name: 1ESPipelineTemplates/MicroBuildTemplate
ref: refs/tags/release
extends:
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
parameters:
pool:
name: VSEngSS-MicroBuild2022-1ES
sdl:
sourceAnalysisPool:
name: AzurePipelines-EO
image: AzurePipelinesWindows2022compliantGPT
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: stage
jobs:
- job: Phase_1
displayName: 'Build'
cancelTimeoutInMinutes: 1
pool:
name: VSEngSS-MicroBuild2022-1ES
templateContext:
mb:
signing:
enabled: true
signType: $(SignType)
sbom:
enabled: true
outputs:
- output: nuget
displayName: 'NuGet push to VS feed'
condition: and(succeeded(), eq(variables['Build.OfficialRelease'], 'true'))
packageParentPath: '$(Build.ArtifactStagingDirectory)\Packages'
packagesToPush: $(Build.ArtifactStagingDirectory)\Packages\*.nupkg;!$(Build.ArtifactStagingDirectory)\package\*.symbols.nupkg
publishVstsFeed: 97a41293-2972-4f48-8c0e-05493ae82010
- output: nuget
displayName: 'NuGet push to NuGet.org'
condition: and(and(succeeded(), eq(variables['Build.OfficialRelease'], 'true')), eq(variables['TimestampPackage'], 'false'))
packageParentPath: '$(Build.ArtifactStagingDirectory)\Packages'
packagesToPush: $(Build.ArtifactStagingDirectory)\Packages\*.nupkg;!$(Build.ArtifactStagingDirectory)\package\*.symbols.nupkg
nuGetFeedType: external
externalEndpoint: XamlBehaviors-NuGet.org
steps:
- checkout: self
clean: true
fetchTags: false
persistCredentials: True
- task: DeleteFiles@1
displayName: Delete output files from src
inputs:
SourceFolder: src
Contents: |-
**\bin\**\*
**\obj\**\*
- task: UseDotNet@2
displayName: Use .NET Core SDK
inputs:
version: 6.x
vsVersion: $(BuildParameters.vsVersion)
performMultiLevelLookup: true
- task: NuGetToolInstaller@1
displayName: Use NuGet 5.8.0
inputs:
versionSpec: 5.8.0
- task: NuGetCommand@2
displayName: NuGet restore
- task: VSBuild@1
displayName: Build solution src\BehaviorsSDK.sln
inputs:
vsVersion: $(BuildParameters.vsVersion)
solution: src\BehaviorsSdk.sln
msbuildArgs: /p:NoWarn=1591 /p:DebugType=full
configuration: Release
maximumCpuCount: true
- task: VSTest@2
displayName: Run Unit Tests
inputs:
testAssemblyVer2: |-
**\*UnitTests.dll
!**\*TestAdapter.dll
!**\obj\**
runInParallel: true
- task: VSBuild@1
displayName: Build NuGet package
inputs:
solution: src\Microsoft.Xaml.Behaviors\Microsoft.Xaml.Behaviors.csproj
msbuildArgs: /t:Pack /p:SignType=$(SignType) /p:TimestampPackage=$(TimestampPackage) /p:NoWarn=1591 /p:DebugType=full
configuration: Release
- task: CopyFiles@2
displayName: 'Copy Symbols to: $(Pipeline.Workspace)\Symbols'
inputs:
SourceFolder: src\Microsoft.Xaml.Behaviors\bin\
Contents: '**\*.pdb'
TargetFolder: $(Pipeline.Workspace)\Symbols
- task: MicroBuildArchiveSymbols@4
displayName: Archive Symbols
condition: and(succeeded(), eq(variables['Build.OfficialRelease'], 'true'))
inputs:
SymbolsFeatureName: XamlBehaviorsWpf
SymbolsProject: VS
SymbolsAgentPath: $(Pipeline.Workspace)\Symbols
ConnectedServiceName: Symbols Upload (DevDiv)
SubmitToInternet: false
- task: CopyFiles@2
displayName: 'Copy NuGet Packages to: $(Build.ArtifactStagingDirectory)\Packages'
inputs:
SourceFolder: src\Microsoft.Xaml.Behaviors\bin\
Contents: '**\*.nupkg'
TargetFolder: $(Build.ArtifactStagingDirectory)\Packages
OverWrite: true
flattenFolders: true
continueOnError: true
Loading