Skip to content

Commit 94e8ca1

Browse files
committed
Tailor for MSAL
1 parent 44ce71b commit 94e8ca1

File tree

4 files changed

+139
-25
lines changed

4 files changed

+139
-25
lines changed

.ado/azure-pipelines.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ parameters:
5353

5454
resources:
5555
repositories:
56-
- repository: dlltracer
57-
name: microsoft/dlltracer-python
56+
- repository: source_repo
57+
name: AzureAD/microsoft-authentication-library-for-python
5858
type: github
59-
ref: main
60-
endpoint: zooba
59+
ref: main # Branch to use?
60+
#endpoint: github.com_Avery-Dunn # Name of service connection
6161
- repository: 1esPipelines
6262
type: git
6363
name: 1ESPipelineTemplates/1ESPipelineTemplates
@@ -68,7 +68,7 @@ trigger: none
6868

6969

7070
variables:
71-
REF: $[ resources.repositories['dlltracer'].ref ]
71+
REF: $[ resources.repositories['source_repo'].ref ]
7272
PIP_DISABLE_PIP_VERSION_CHECK: true
7373
PIP_NO_COLOR: true
7474
PIP_NO_INPUT: true
@@ -89,7 +89,7 @@ extends:
8989
sdl:
9090
sourceRepositoriesToScan:
9191
include:
92-
- repository: dlltracer
92+
- repository: source_repo
9393

9494
customBuildTags:
9595
- ${{ if eq(parameters.Signed, 'true') }}:

.ado/build.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Derived from https://dev.azure.com/mseng/Python/_git/dlltracer-python?path=/build.yml
12
parameters:
23
Artifact: dist
34
pythons: []
@@ -18,7 +19,8 @@ jobs:
1819
value: $(Build.BinariesDirectory)/layout
1920

2021
steps:
21-
- checkout: dlltracer
22+
- checkout: self
23+
submodules: false
2224

2325
- task: UsePythonVersion@0
2426
inputs:
@@ -36,26 +38,30 @@ jobs:
3638
architecture: '${{ py.arch }}'
3739
addToPath: false
3840

39-
- task: PipAuthenticate@1
40-
inputs:
41-
artifactFeeds: Python
42-
displayName: 'Authenticate pip for internal feed'
41+
#- task: PipAuthenticate@1
42+
# inputs:
43+
# artifactFeeds: Python
44+
# displayName: 'Authenticate pip for internal feed'
4345

44-
- powershell: |
45-
python -m pip install pymsbuild Cython
46+
#- powershell: |
47+
# python -m pip install pymsbuild Cython
48+
# displayName: 'Install dependencies'
49+
- script: |
50+
python -m pip install pymsbuild
4651
displayName: 'Install dependencies'
4752
48-
- powershell: |
49-
Write-Output "##vso[task.setvariable variable=GITHUB_REF]$(REF)"
50-
displayName: 'Update build reference'
51-
condition: and(succeeded(), startswith(variables['REF'], 'refs/tags/'))
53+
#- powershell: |
54+
# Write-Output "##vso[task.setvariable variable=GITHUB_REF]$(REF)"
55+
# displayName: 'Update build reference'
56+
# condition: and(succeeded(), startswith(variables['REF'], 'refs/tags/'))
5257

5358
##############################################################################
5459
# BUILD SDIST and EXTENSION MODULES
5560
##############################################################################
5661

5762
# sdist requires no signing/SBOM or special handling, so just build it
58-
- powershell: |
63+
#- powershell: |
64+
- script: |
5965
python -m pymsbuild sdist -d $(DistDir)
6066
displayName: 'Build sdist'
6167
@@ -91,8 +97,8 @@ jobs:
9197
"KeyCode" : "${{parameters.SigningKeyCode}}",
9298
"OperationCode" : "SigntoolSign",
9399
"Parameters" : {
94-
"OpusName" : "dlltracer-python $(REF)",
95-
"OpusInfo" : "https://github.com/microsoft/dlltracer-python/",
100+
"OpusName" : "microsoft-authentication-library-for-python $(REF)",
101+
"OpusInfo" : "https://github.com/AzureAD/microsoft-authentication-library-for-python",
96102
"Append" : "/as",
97103
"FileDigest" : "/fd \"SHA256\"",
98104
"PageHash" : "/NPH",
@@ -152,8 +158,8 @@ jobs:
152158
displayName: 'Test that SDist will build'
153159
154160
- powershell: |
155-
python -m pip install dlltracer
156-
if ($?) { python -c "import dlltracer, dlltracer._native" }
161+
python -m pip install -r requirements.txt
162+
if ($?) { python -c "import msal; print(msal.__version__)" }
157163
displayName: 'Check that built module will import'
158164
env:
159165
PIP_NO_DEPS: 1

.ado/esrp.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#################################################################################
2+
# OneBranch Pipelines - Official and CI #
3+
# This pipeline was created by EasyStart from a sample located at: #
4+
# https://aka.ms/obpipelines/easystart/samples #
5+
# Documentation: https://aka.ms/obpipelines #
6+
# Yaml Schema: https://aka.ms/obpipelines/yaml/schema #
7+
# Retail Tasks: https://aka.ms/obpipelines/tasks #
8+
# Support: https://aka.ms/onebranchsup #
9+
#################################################################################
10+
11+
trigger: none # https://aka.ms/obpipelines/triggers
12+
13+
parameters: # parameters are shown up in ADO UI in a build queue time
14+
- name: 'debug'
15+
displayName: 'Enable debug output'
16+
type: boolean
17+
default: false
18+
19+
variables:
20+
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
21+
system.debug: ${{ parameters.debug }}
22+
ENABLE_PRS_DELAYSIGN: 1
23+
ROOT: $(Build.SourcesDirectory)
24+
REPOROOT: $(Build.SourcesDirectory)
25+
OUTPUTROOT: $(REPOROOT)\out
26+
NUGET_XMLDOC_MODE: none
27+
28+
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' # https://aka.ms/obpipelines/containers
29+
30+
resources:
31+
repositories:
32+
- repository: templates
33+
type: git
34+
name: OneBranch.Pipelines/GovernedTemplates
35+
ref: refs/heads/main
36+
37+
extends:
38+
template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
39+
parameters:
40+
cloudvault: # https://aka.ms/obpipelines/cloudvault
41+
'enabled': false
42+
globalSdl: # https://aka.ms/obpipelines/sdl
43+
asyncSdl: # https://aka.ms/obpipelines/asyncsdl
44+
enabled: false
45+
# tsa:
46+
# enabled: true
47+
# breakOnFailure: true
48+
# credscan:
49+
# suppressionsFile: $(Build.SourcesDirectory)\.config\CredScanSuppression.json
50+
binskim:
51+
break: true # always break the build on binskim issues. You can disable it by setting to 'false'
52+
policheck:
53+
break: true # always break the build on policheck issues. You can disable it by setting to 'false'
54+
exclusionsFile: $(Build.SourcesDirectory)\.config\PolicheckExclusion.xml
55+
suppression:
56+
suppressionFile: $(Build.SourcesDirectory)\.gdn\global.gdnsuppress #suppressing signing issues for Xamarin dlls
57+
perStage:
58+
sdl_sources:
59+
checkout_all_repos: true
60+
featureFlags:
61+
WindowsHostVersion: '1ESWindows2022'
62+
63+
stages:
64+
- stage: build
65+
jobs:
66+
- job: main
67+
timeoutInMinutes: 120
68+
pool:
69+
type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
70+
71+
variables:
72+
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts
73+
ob_sdl_binskim_break: true # https://aka.ms/obpipelines/sdl
74+
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}: # conditionally enable symbolsPublishing for default branch only
75+
ob_symbolsPublishing_enabled: true # https://aka.ms/obpipelines/symbols
76+
ob_symbolsPublishing_searchPattern: '**/*.pdb'
77+
ob_symbolsPublishing_indexSources: true
78+
ob_symbolsPublishing_symbolsFolder: $(Build.SourcesDirectory)/microsoft-authentication-library-for-java/msal4j-sdk/src
79+
${{ if eq(variables['variables.UploadPackages'], 'true') }}: #Uploads packages to VSTS feed. Only enabled on official build
80+
ob_nugetPublishing_enabled: true
81+
82+
steps:
83+
- checkout: self
84+
submodules: false
85+
86+
- script: |
87+
python -m pip install build --user
88+
python -m build --sdist --wheel --outdir "$(Build.ArtifactStagingDirectory)" .
89+
90+
- task: EsrpRelease@7
91+
inputs:
92+
DisplayName: 'Publish to PyPI'
93+
ConnectedServiceName: 'AuthSdkResourceManager'
94+
KeyVaultName: 'buildautomation'
95+
AuthCertName: 'MSALJava-ESRP-Release-Auth-PrivateCA'
96+
SignCertName: 'MSALJava-ESRP-Release-Sign-PublicCA'
97+
ClientId: 'b8d01fe0-7a50-4af7-abce-571ec99e87a0'
98+
Intent: 'PackageDistribution'
99+
ContentType: 'PyPI'
100+
ContentSource: 'Folder'
101+
FolderLocation: '$(Build.ArtifactStagingDirectory)/dist'
102+
waitforreleasecompletion: true
103+
104+
Approvers: '[email protected]'
105+
ServiceEndpointUrl: 'https://api.esrp.microsoft.com'
106+
MainPublisher: 'ESRPRELPACMAN'
107+
DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
108+

.ado/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
displayName: 'Download built distribution'
1919

2020
- ${{ if eq(parameters.Feed, 'pypi') }}:
21-
- task: EsrpRelease@4
21+
- task: EsrpRelease@7
2222
displayName: 'ESRP Release to PyPI'
2323
inputs:
2424
ConnectedServiceName: 'Python ESRP Release'
2525
Intent: PackageDistribution
2626
ContentType: PyPI
2727
FolderLocation: $(DistDir)
28-
Owners: 'stevdo@microsoft.com'
29-
Approvers: 'grwheele@microsoft.com'
28+
Owners: 'nugetaad@microsoft.com'
29+
Approvers: 'rayluo@microsoft.com'
3030
ServiceEndpointUrl: 'https://api.esrp.microsoft.com'
3131
MainPublisher: 'Python'
3232
DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'

0 commit comments

Comments
 (0)