|
3 | 3 | # Unified pipeline stages template for the msal Python package. |
4 | 4 | # |
5 | 5 | # Called from: |
6 | | -# pipeline-publish.yml — release build (runPublish: true) |
7 | | -# (future) pipeline-ci.yml — post-merge CI (runPublish: false) |
8 | | -# (future) pipeline-pullrequest.yml — PR gate (runPublish: false) |
| 6 | +# pipeline-publish.yml — release build (SDL scans + test matrix) |
| 7 | +# azure-pipelines.yml — PR gate and post-merge CI |
9 | 8 | # |
10 | | -# Parameters: |
11 | | -# packageVersion - Version to validate against msal/sku.py |
12 | | -# Required when runPublish is true; unused otherwise. |
13 | | -# publishTarget - 'test.pypi.org (Preview / RC)' or 'pypi.org (Production)' |
14 | | -# Required when runPublish is true; unused otherwise. |
15 | | -# runPublish - When true: also run Validate, Build, and Publish stages. |
16 | | -# When false (PR / merge builds): only the CI stage runs. |
| 9 | +# Package publishing is handled via the ESRP release path (not in this template). |
17 | 10 | # |
18 | 11 | # Stage flow: |
19 | 12 | # |
20 | | -# runPublish: true → PreBuildCheck ─► Validate ─► CI ─► Build ─► PublishMSALPython |
21 | | -# └─► PublishPyPI |
22 | | -# runPublish: false → PreBuildCheck ─► CI (Validate / Build / Publish are skipped) |
23 | | - |
24 | | -parameters: |
25 | | -- name: packageVersion |
26 | | - type: string |
27 | | - default: '' |
28 | | -- name: publishTarget |
29 | | - type: string |
30 | | - default: '' |
31 | | -- name: runPublish |
32 | | - type: boolean |
33 | | - default: false |
| 13 | +# PreBuildCheck ─► CI |
34 | 14 |
|
35 | 15 | stages: |
36 | 16 |
|
@@ -73,55 +53,12 @@ stages: |
73 | 53 | GdnBreakGdnToolPoliCheck: true |
74 | 54 |
|
75 | 55 | # ══════════════════════════════════════════════════════════════════════════════ |
76 | | -# Stage 1 · Validate — verify packageVersion matches msal/sku.py __version__ |
77 | | -# Skipped when runPublish is false (PR / merge builds). |
78 | | -# ══════════════════════════════════════════════════════════════════════════════ |
79 | | -- stage: Validate |
80 | | - displayName: 'Validate version' |
81 | | - dependsOn: PreBuildCheck |
82 | | - condition: and(${{ parameters.runPublish }}, eq(dependencies.PreBuildCheck.result, 'Succeeded')) |
83 | | - jobs: |
84 | | - - job: ValidateVersion |
85 | | - displayName: 'Check version matches source' |
86 | | - pool: |
87 | | - vmImage: ubuntu-latest |
88 | | - steps: |
89 | | - - task: UsePythonVersion@0 |
90 | | - inputs: |
91 | | - versionSpec: '3.12' |
92 | | - displayName: 'Set up Python' |
93 | | - |
94 | | - - bash: | |
95 | | - PARAM_VER="${{ parameters.packageVersion }}" |
96 | | - SKU_VER=$(grep '__version__' msal/sku.py | sed 's/.*"\(.*\)".*/\1/') |
97 | | -
|
98 | | - if [ -z "$PARAM_VER" ]; then |
99 | | - echo "##vso[task.logissue type=error]packageVersion is required. Enter the version to publish (must match msal/sku.py __version__)." |
100 | | - exit 1 |
101 | | - elif [ "$PARAM_VER" != "$SKU_VER" ]; then |
102 | | - echo "##vso[task.logissue type=error]Version mismatch: parameter '$PARAM_VER' != msal/sku.py '$SKU_VER'" |
103 | | - echo "Update msal/sku.py __version__ to match the packageVersion parameter, or correct the parameter." |
104 | | - exit 1 |
105 | | - else |
106 | | - echo "Version validated: $PARAM_VER" |
107 | | - fi |
108 | | - displayName: 'Verify version parameter matches msal/sku.py' |
109 | | -
|
110 | | -# ══════════════════════════════════════════════════════════════════════════════ |
111 | | -# Stage 2 · CI — run the full test matrix across all supported Python versions. |
112 | | -# Always runs. Waits for Validate when runPublish is true; |
113 | | -# runs immediately when Validate is skipped (PR / merge builds). |
| 56 | +# Stage 1 · CI — run the full test matrix across all supported Python versions. |
114 | 57 | # ══════════════════════════════════════════════════════════════════════════════ |
115 | 58 | - stage: CI |
116 | 59 | displayName: 'Run tests' |
117 | | - dependsOn: |
118 | | - - PreBuildCheck |
119 | | - - Validate |
120 | | - condition: | |
121 | | - and( |
122 | | - eq(dependencies.PreBuildCheck.result, 'Succeeded'), |
123 | | - in(dependencies.Validate.result, 'Succeeded', 'Skipped') |
124 | | - ) |
| 60 | + dependsOn: PreBuildCheck |
| 61 | + condition: eq(dependencies.PreBuildCheck.result, 'Succeeded') |
125 | 62 | jobs: |
126 | 63 | - job: Test |
127 | 64 | displayName: 'Run unit tests' |
@@ -204,10 +141,6 @@ stages: |
204 | 141 | - bash: rm -f "$(Agent.TempDirectory)/lab-auth.pfx" |
205 | 142 | displayName: 'Clean up lab certificate' |
206 | 143 | condition: and(always(), ne(variables['LAB_APP_CLIENT_ID'], '')) |
207 | | - |
208 | | -# ══════════════════════════════════════════════════════════════════════════════ |
209 | | -# Stage 3 · Build — build sdist + wheel (release only) |
210 | | -# ══════════════════════════════════════════════════════════════════════════════ |
211 | 144 | - stage: Build |
212 | 145 | displayName: 'Build package' |
213 | 146 | dependsOn: CI |
|
0 commit comments