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

Use 1ES pipeline template for build pipeline #2993

Merged
merged 1 commit into from
Oct 10, 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
145 changes: 82 additions & 63 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,86 +2,105 @@
# Licensed under the MIT License.
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
parameters:
- name: BuildAgent
default: 1es-windows-ps-compute
displayName: Build Agent
- name: Test
type: boolean
default: true
- name: Pack
type: boolean
default: true
- name: Sign
type: boolean
default: true
- name: BuildAgent
default: 1es-windows-ps-compute
displayName: Build Agent
- name: Test
type: boolean
default: true
- name: Pack
type: boolean
default: true
- name: Sign
type: boolean
default: true

variables:
BuildAgent: ${{ parameters.BuildAgent }}
GitUserEmail: "[email protected]"
GitUserName: "Microsoft Graph DevX Tooling"

pool: $(BuildAgent)

trigger:
branches:
include:
- main
- dev
- main
- dev
pr:
branches:
include:
- main
- dev

jobs:
- job: MsGraphPsSdkCiBuild
displayName: Microsoft Graph PowerShell SDK CI Build
timeoutInMinutes: 840
steps:
- script: |
git submodule update --init --recursive
- template: ./common-templates/install-tools.yml
- template: ./common-templates/security-pre-checks.yml

- template: ./generation-templates/authentication-module.yml
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}
- main
- dev
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool: $(BuildAgent)
sdl:
binskim:
enabled: false
justificationForDisabling: "Binskim keeps on crushing and failing the weekly build pipeline. Disabling it for now because we are unable to publish the artifacts to internal feeds."
credscan:
suppressionsFile: $(Build.SourcesDirectory)/.azure-pipelines/config/credscan/credscan-suppressions.json
policheck:
exclusionFile: $(Build.SourcesDirectory)/.azure-pipelines/config/policheck/policheck-exclusions.xml
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: stage
jobs:
- job: MsGraphPsSdkCiBuild
displayName: Microsoft Graph PowerShell SDK CI Build
timeoutInMinutes: 840
templateContext:
outputs:
- ${{ if and(eq(parameters.Pack, true), eq(parameters.Sign, true)) }}:
- output: pipelineArtifact
displayName: 'Publish Module Artifacts'
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
publishLocation: 'Container'
- ${{ if and(eq(parameters.Pack, true), eq(parameters.Sign, true)) }}:
- output: nuget
displayName: 'Publish NuGet to feed'
packageParentPath: '$(Build.ArtifactStagingDirectory)'
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Graph.*.nupkg
publishVstsFeed: $(PROJECT_NAME)/$(FEED_NAME)
allowPackageConflicts: true
steps:
- script: |
git submodule update --init --recursive
- template: .azure-pipelines/common-templates/install-tools.yml@self
- template: .azure-pipelines/common-templates/security-pre-checks.yml@self

- template: .azure-pipelines/generation-templates/authentication-module.yml@self
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}

- template: ./generation-templates/workload-modules.yml
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}
- template: .azure-pipelines/generation-templates/workload-modules.yml@self
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}

- template: ./generation-templates/meta-module.yml
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}
- template: .azure-pipelines/generation-templates/meta-module.yml@self
parameters:
Test: ${{ parameters.Test }}
Pack: ${{ parameters.Pack }}
Sign: ${{ parameters.Sign }}

- template: ./common-templates/guardian-analyzer.yml
- template: .azure-pipelines/common-templates/guardian-analyzer.yml@self

- ${{ if and(eq(parameters.Pack, true), eq(parameters.Sign, true)) }}:
- template: ./common-templates/esrp/codesign-nuget.yml
- ${{ if and(eq(parameters.Pack, true), eq(parameters.Sign, true)) }}:
- template: .azure-pipelines/common-templates/esrp/codesign-nuget.yml@self
parameters:
FolderPath: "$(Build.ArtifactStagingDirectory)"
Pattern: "Microsoft.Graph*.nupkg"

- task: PublishBuildArtifacts@1
displayName: Publish Module Artifacts
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)"
ArtifactName: "drop"
publishLocation: "Container"

- task: NuGetCommand@2
displayName: Publish NuGet to feed
inputs:
command: push
packagesToPush: $(Build.ArtifactStagingDirectory)/**/Microsoft.Graph.*.nupkg
publishVstsFeed: $(PROJECT_NAME)/$(FEED_NAME)
allowPackageConflicts: true

- template: ./common-templates/security-post-checks.yml
- template: .azure-pipelines/common-templates/security-post-checks.yml@self