-
Notifications
You must be signed in to change notification settings - Fork 90
feat(pipeline): add Azure Pipelines configuration for building and publishing library #1514
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
Open
MIchaelMainer
wants to merge
4
commits into
main
Choose a base branch
from
mmainer/cd-enhancement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d4f8a3b
feat(pipeline): add Azure Pipelines configuration for building and pu…
MIchaelMainer 2425034
chore: no trigger on commit to main
MIchaelMainer d4e675d
fix: update package owners and approvers in Azure Pipelines configura…
MIchaelMainer 023c349
chore(pipeline): update artifact feed for pip authentication
MIchaelMainer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| # Build, package, and deploy msgraph-sdk-python to PyPI. | ||
|
|
||
| name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) | ||
|
|
||
| trigger: | ||
| tags: | ||
| include: | ||
| - v* | ||
|
|
||
| pr: none | ||
|
|
||
| variables: | ||
| pythonVersion: '3.14' | ||
|
|
||
| resources: | ||
| repositories: | ||
| - repository: 1ESPipelineTemplates | ||
| type: git | ||
| name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
| ref: refs/tags/release | ||
|
|
||
| extends: | ||
| template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates | ||
| parameters: | ||
| pool: | ||
| name: Azure-Pipelines-1ESPT-ExDShared | ||
| image: ubuntu-latest | ||
| os: linux | ||
| sdl: | ||
| sourceAnalysisPool: | ||
| name: Azure-Pipelines-1ESPT-ExDShared | ||
| image: windows-2022 | ||
| os: windows | ||
| stages: | ||
| - stage: build | ||
| displayName: Build and Package msgraph-sdk-python | ||
| condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.Reason'], 'Manual')) | ||
| jobs: | ||
| - job: build_python | ||
| displayName: Build and Package | ||
| pool: | ||
| name: Azure-Pipelines-1ESPT-ExDShared | ||
| image: ubuntu-latest | ||
| os: linux | ||
| steps: | ||
| - checkout: self | ||
|
|
||
| - task: UsePythonVersion@0 | ||
| displayName: Install Python $(pythonVersion) | ||
| inputs: | ||
| versionSpec: $(pythonVersion) | ||
| addToPath: true | ||
|
|
||
| - script: python -m pip install --upgrade pip | ||
| displayName: Upgrade pip | ||
|
|
||
| - task: PipAuthenticate@1 | ||
| displayName: "Authenticate pip to Azure Artifacts" | ||
| inputs: | ||
| artifactFeeds: "$(System.TeamProject)/GraphDeveloperExperiences_Public" | ||
|
|
||
| - script: pip install -r requirements-dev.txt | ||
| displayName: Install dependencies | ||
|
|
||
| - script: pylint msgraph --disable=W --rcfile=.pylintrc | ||
| displayName: Lint with Pylint | ||
|
|
||
| - script: python -m build | ||
| displayName: Build package artifacts | ||
|
|
||
| - task: CopyFiles@2 | ||
| displayName: Copy package artifacts to staging | ||
| inputs: | ||
| CleanTargetFolder: true | ||
| sourceFolder: $(Build.SourcesDirectory) | ||
| targetFolder: $(Build.ArtifactStagingDirectory)/python/msgraph_sdk | ||
| Contents: | | ||
| dist/*.tar.gz | ||
| dist/*.whl | ||
| flattenFolders: true | ||
|
|
||
| templateContext: | ||
| outputs: | ||
| - output: pipelineArtifact | ||
| displayName: Stage msgraph-sdk package artifacts | ||
| artifactName: pypi_msgraph_sdk_package | ||
| targetPath: $(Build.ArtifactStagingDirectory)/python/msgraph_sdk | ||
| condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.Reason'], 'Manual')) | ||
|
|
||
| - stage: deploy | ||
| displayName: Publish msgraph-sdk-python to PyPI | ||
| dependsOn: build | ||
| condition: or(and(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), succeeded()), eq(variables['Build.Reason'], 'Manual')) | ||
| jobs: | ||
| - deployment: publish_python_package | ||
| displayName: Publish msgraph-sdk package | ||
| environment: pypi_prod | ||
| pool: | ||
| name: Azure-Pipelines-1ESPT-ExDShared | ||
| image: ubuntu-latest | ||
| os: linux | ||
| templateContext: | ||
| type: releaseJob | ||
| isProduction: true | ||
| inputs: | ||
| - input: pipelineArtifact | ||
| artifactName: pypi_msgraph_sdk_package | ||
| targetPath: $(Build.ArtifactStagingDirectory)/python | ||
| strategy: | ||
| runOnce: | ||
| deploy: | ||
| steps: | ||
| - task: EsrpRelease@9 | ||
| displayName: Publish msgraph-sdk package via ESRP Release | ||
| inputs: | ||
| connectedservicename: Federated DevX ESRP Managed Identity Connection | ||
| usemanagedidentity: false | ||
| keyvaultname: akv-prod-eastus | ||
| authcertname: ReferenceLibraryPrivateCert | ||
| signcertname: ReferencePackagePublisherCertificate | ||
| clientid: 65035b7f-7357-4f29-bf25-c5ee5c3949f8 | ||
| intent: PackageDistribution | ||
| contenttype: PYPI | ||
| contentsource: Folder | ||
| folderlocation: $(Build.ArtifactStagingDirectory)/python | ||
| waitforreleasecompletion: true | ||
| owners: 'mmainer@microsoft.com,gavinbarron@microsoft.com' | ||
| approvers: 'mmainer@microsoft.com,christiano@microsoft.com,gavinbarron@microsoft.com' | ||
| mainpublisher: ESRPRELPACMAN | ||
| domaintenantid: cdc5aeea-15c5-4db6-b079-fcadd2505dc2 | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.