diff --git a/.ado/publish.yml b/.ado/publish.yml index 9b46271757a8ec..a1be47f283d0a7 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -111,6 +111,7 @@ jobs: command: pack packagesToPack: 'ReactAndroid/ReactAndroid.nuspec' packDestination: '$(Build.StagingDirectory)\final' + buildProperties: buildNumber=$(buildNumber);commitId=$(Build.SourceVersion) - task: CmdLine@2 displayName: Do Publish diff --git a/.ado/templates/prep-android-nuget.yml b/.ado/templates/prep-android-nuget.yml index 76b73222e21072..b3eaa18dd17dbd 100644 --- a/.ado/templates/prep-android-nuget.yml +++ b/.ado/templates/prep-android-nuget.yml @@ -1,12 +1,12 @@ steps: - task: PowerShell@2 - displayName: Extract version from package.json, and put it in nuspec + displayName: Extract version from package.json, and put it in `buildNumber` variable inputs: targetType: inline # filePath | inline script: | $lines = Get-Content package.json | Where {$_ -match '^\s*"version":.*'} $npmVersion = $lines.Trim().Split()[1].Trim('",'); - (Get-Content ReactAndroid/ReactAndroid.nuspec).replace('__BuildBuildNumber__', $npmVersion) | Set-Content ReactAndroid/ReactAndroid.nuspec + echo "##vso[task.setvariable variable=buildNumber]$($npmVersion)" # Pretty yucky - but we dont want devmain to have to update versions _all_ over the place - task: PowerShell@2 diff --git a/ReactAndroid/ReactAndroid.nuspec b/ReactAndroid/ReactAndroid.nuspec index 90fe2f6a38f98a..5ed23fba7c3e71 100644 --- a/ReactAndroid/ReactAndroid.nuspec +++ b/ReactAndroid/ReactAndroid.nuspec @@ -2,10 +2,11 @@ OfficeReact.Android - __BuildBuildNumber__ + $buildNumber$ Contains Android Implementation of React-Native Microsoft https://github.com/microsoft/react-native + false diff --git a/ReactApple/ReactApple.nuspec b/ReactApple/ReactApple.nuspec index e71ad92efebd46..5066196adc2d77 100644 --- a/ReactApple/ReactApple.nuspec +++ b/ReactApple/ReactApple.nuspec @@ -2,7 +2,7 @@ OfficeReact.Apple - __BuildBuildNumber__ + $buildNumber$ Contains Mac and iOS Implementations of React-Native Microsoft https://github.com/microsoft/react-native