Skip to content

Commit 47b45d9

Browse files
authored
Fix the versioning on Foundation nuspec (#800)
1 parent 589244f commit 47b45d9

6 files changed

Lines changed: 31 additions & 102 deletions

build/AzurePipelinesTemplates/ProjectReunion-CreateNugetPackage-Job.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ parameters:
77
# The "primary" build arch is the one that the nuspec gets its winmd, pri, and other neutral files from
88
primaryBuildArch: x86
99
buildFlavor: Release
10-
useReleaseTag: 'false'
1110
prereleaseVersionTag: 'prerelease'
1211
condition: ''
13-
major: '0'
14-
minor: '5'
15-
patch: '0'
1612

1713
jobs:
1814
- job: ${{ parameters.jobName }}
@@ -31,7 +27,6 @@ jobs:
3127
echo parameters.publishPath '${{ parameters.publishPath }}'
3228
echo buildrevision=$(buildrevision)
3329
echo builddate=$(builddate)
34-
echo useReleaseTag=${{ parameters.useReleaseTag }}
3530
displayName: 'CreateNugetPackage: Display parameters'
3631
3732
- task: DownloadBuildArtifacts@0
@@ -87,15 +82,23 @@ jobs:
8782

8883
# displayName: 'build-nupkg.ps1'
8984

85+
- task: PowerShell@2
86+
displayName: Update metapackage version
87+
inputs:
88+
targetType: 'inline'
89+
script: |
90+
$packageVersion = '$(version).${{ parameters.prereleaseVersionTag }}'
91+
Write-Host version: $packageVersion
92+
[xml]$publicNuspec = Get-Content -Path $(Build.SourcesDirectory)\build\NuSpecs\Microsoft.ProjectReunion.Foundation.nuspec
93+
$publicNuspec.package.metadata.version = $packageVersion
94+
Set-Content -Value $publicNuspec.OuterXml $(Build.SourcesDirectory)\build\NuSpecs\Microsoft.ProjectReunion.Foundation.nuspec
95+
9096
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
9197
displayName: 'Pack Full Nuget Package'
9298
inputs:
9399
command: 'pack'
94100
packagesToPack: '$(Build.SourcesDirectory)\build\NuSpecs\Microsoft.ProjectReunion.Foundation.nuspec'
95-
versioningScheme: 'byPrereleaseNumber'
96-
majorVersion: ${{ parameters.major }}
97-
minorVersion: ${{ parameters.minor }}
98-
patchVersion: ${{ parameters.patch }}
101+
versioningScheme: 'off'
99102
basePath: '${{ parameters.fullnupkgdir }}'
100103
packDestination: ${{ parameters.fullnupkgdir }}
101104

build/ProjectReunion-BuildFoundation.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
22
variables:
3-
minimumExpectedTestsExecutedCount: 35 # Sanity check for minimum expected tests to be reported
3+
- template: ProjectReunion-Versions.yml
4+
- template: ProjectReunion-CommonVariables.yml
45

56
parameters:
67
- name: "ReleaseSigning"
@@ -361,7 +362,7 @@ jobs:
361362
dependsOn: SignBinariesAndPublishSymbols
362363
signConfigPattern: 'Microsoft.ProjectReunion*.nupkg'
363364
useReleaseTag: '$(ProjectReunionFinalRelease)'
364-
prereleaseVersionTag: prerelease
365+
prereleaseVersionTag: nightly
365366

366367
# Build solution that depends on nuget package
367368
#- template: AzurePipelinesTemplates\ProjectReunion-NugetReleaseTest-Job.yml

build/ProjectReunion-CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# see https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases for info on yaml ADO jobs
22
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
33
variables:
4-
minimumExpectedTestsExecutedCount: 500 # Sanity check for minimum expected tests to be reported
5-
rerunPassesRequiredToAvoidFailure: 5
4+
- template: ProjectReunion-Versions.yml
5+
- template: ProjectReunion-CommonVariables.yml
66

77
jobs:
88
- job: CredScan
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
variables:
2+
rerunPassesRequiredToAvoidFailure: 5
3+
versionDate: $[format('{0:yyyyMMdd}', pipeline.startTime)]
4+
versionCounter: $[counter(variables['versionDate'], 0)]
5+
version: >
6+
$[format('{0}.{1}.{2}-{3}.{4}.{5}',
7+
variables['major'], variables['minor'], variables['patch'], variables['branch'],
8+
variables['versionDate'], variables['versionCounter'])]

build/ProjectReunion-PR.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

build/ProjectReunion-Versions.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
variables:
2+
# Version Control
3+
major: "0"
4+
minor: "8"
5+
patch: "0"
6+
branch: 'main'

0 commit comments

Comments
 (0)