Skip to content

Commit 9d3097c

Browse files
committed
build: nightly build always builds both packages
Add effectiveBuildPackage variable that forces 'both' on scheduled (Build.Reason=Schedule) runs while manual/PR runs honour the buildPackage parameter. Mirrors the effectiveOneBranchType pattern so the nightly keeps refreshing every artifact.
1 parent a4e3968 commit 9d3097c

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

OneBranchPipelines/build-release-package-pipeline.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ parameters:
7676
# mssql-python -> Windows/macOS/Linux wheels + Consolidate
7777
# mssql-python-odbc -> ODBC data wheels + ConsolidateOdbc
7878
# both -> everything (previous default behaviour)
79-
# Scheduled (daily) builds use this default too, so they build mssql-python only.
79+
# Scheduled (daily) builds ignore this and always build 'both' (see
80+
# effectiveBuildPackage below) so the nightly keeps producing every artifact.
8081
- name: buildPackage
8182
displayName: 'Package to Build'
8283
type: string
@@ -192,6 +193,14 @@ variables:
192193
value: 'Official'
193194
${{ else }}:
194195
value: '${{ parameters.oneBranchType }}'
196+
197+
# Determine which package(s) to build: scheduled (nightly) builds always build
198+
# 'both' so every artifact keeps refreshing; manual/PR builds honour the parameter.
199+
- name: effectiveBuildPackage
200+
${{ if eq(variables['Build.Reason'], 'Schedule') }}:
201+
value: 'both'
202+
${{ else }}:
203+
value: '${{ parameters.buildPackage }}'
195204

196205
# Variable template imports
197206
# Each file provides specific variable groups:
@@ -401,7 +410,7 @@ extends:
401410
# 6. Publishes artifacts (wheels + PYD + PDB)
402411
# 7. ESRP malware scanning
403412
# Gate: build mssql-python stages unless an odbc-only build was requested
404-
- ${{ if ne(parameters.buildPackage, 'mssql-python-odbc') }}:
413+
- ${{ if ne(variables.effectiveBuildPackage, 'mssql-python-odbc') }}:
405414
- ${{ each config in parameters.windowsConfigs }}:
406415
- template: /OneBranchPipelines/stages/build-windows-single-stage.yml@self
407416
parameters:
@@ -428,7 +437,7 @@ extends:
428437
# 6. Builds wheel
429438
# 7. Publishes artifacts (wheels + .so)
430439
# 8. ESRP malware scanning
431-
- ${{ if ne(parameters.buildPackage, 'mssql-python-odbc') }}:
440+
- ${{ if ne(variables.effectiveBuildPackage, 'mssql-python-odbc') }}:
432441
- ${{ each config in parameters.macosConfigs }}:
433442
- template: /OneBranchPipelines/stages/build-macos-single-stage.yml@self
434443
parameters:
@@ -459,7 +468,7 @@ extends:
459468
# d. Runs pytest against SQL Server
460469
# 4. Publishes artifacts (all 5 wheels)
461470
# 5. Component Governance + AntiMalware scanning
462-
- ${{ if ne(parameters.buildPackage, 'mssql-python-odbc') }}:
471+
- ${{ if ne(variables.effectiveBuildPackage, 'mssql-python-odbc') }}:
463472
- ${{ each config in parameters.linuxConfigs }}:
464473
- template: /OneBranchPipelines/stages/build-linux-single-stage.yml@self
465474
parameters:
@@ -482,7 +491,7 @@ extends:
482491
# - dist/bindings/macOS/*.so (macOS universal2 binaries)
483492
# - dist/bindings/Linux/*.so (Linux native extensions)
484493
# This stage also runs final BinSkim scan on all binaries
485-
- ${{ if ne(parameters.buildPackage, 'mssql-python-odbc') }}:
494+
- ${{ if ne(variables.effectiveBuildPackage, 'mssql-python-odbc') }}:
486495
- stage: Consolidate
487496
displayName: 'Consolidate All Artifacts'
488497
dependsOn:
@@ -529,7 +538,7 @@ extends:
529538
#
530539
# ODBC Windows stages (2): ODBC_Win_x64, ODBC_Win_arm64
531540
# Gate: build mssql-python-odbc stages unless an mssql-python-only build was requested
532-
- ${{ if ne(parameters.buildPackage, 'mssql-python') }}:
541+
- ${{ if ne(variables.effectiveBuildPackage, 'mssql-python') }}:
533542
- ${{ each config in parameters.odbcWindowsConfigs }}:
534543
- template: /OneBranchPipelines/stages/build-odbc-windows-stage.yml@self
535544
parameters:
@@ -539,7 +548,7 @@ extends:
539548
oneBranchType: '${{ variables.effectiveOneBranchType }}'
540549

541550
# ODBC macOS stage (1): ODBC_MacOS_universal2
542-
- ${{ if ne(parameters.buildPackage, 'mssql-python') }}:
551+
- ${{ if ne(variables.effectiveBuildPackage, 'mssql-python') }}:
543552
- ${{ each config in parameters.odbcMacosConfigs }}:
544553
- template: /OneBranchPipelines/stages/build-odbc-macos-stage.yml@self
545554
parameters:
@@ -548,7 +557,7 @@ extends:
548557
oneBranchType: '${{ variables.effectiveOneBranchType }}'
549558

550559
# ODBC Linux stages (4): manylinux_2_28 x86_64/aarch64, musllinux x86_64/aarch64
551-
- ${{ if ne(parameters.buildPackage, 'mssql-python') }}:
560+
- ${{ if ne(variables.effectiveBuildPackage, 'mssql-python') }}:
552561
- ${{ each config in parameters.odbcLinuxConfigs }}:
553562
- template: /OneBranchPipelines/stages/build-odbc-linux-stage.yml@self
554563
parameters:
@@ -566,7 +575,7 @@ extends:
566575
# publishes them as `drop_ConsolidateOdbc_ConsolidateArtifacts` (distinct from
567576
# the mssql-python `drop_Consolidate_ConsolidateArtifacts`). The release
568577
# pipeline selects one artifact based on its `releasePackage` parameter.
569-
- ${{ if ne(parameters.buildPackage, 'mssql-python') }}:
578+
- ${{ if ne(variables.effectiveBuildPackage, 'mssql-python') }}:
570579
- stage: ConsolidateOdbc
571580
displayName: 'Consolidate All ODBC Artifacts'
572581
dependsOn:

0 commit comments

Comments
 (0)