Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .ado/bumpFileVersions.js

This file was deleted.

36 changes: 19 additions & 17 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,11 @@ jobs:

- task: CmdLine@2
displayName: Update package version
name: updateVersionTask
inputs:
script: node ../.ado/updateVersion.js
workingDirectory: vnext

# since the above task will update the package.json, we want to ensure that we use the correct version for the nuget
- task: PublishBuildArtifacts@1
displayName: 'Publish updated package.json for nuget'
inputs:
PathtoPublish: 'vnext\package.json'
ArtifactName: 'UpdatedPackageJson'

- task: Npm@1
displayName: npm public publish (vnext)
inputs:
Expand All @@ -61,6 +55,8 @@ jobs:
- job: RnwNativeBuild
displayName: React-Native-Windows Native Build
dependsOn: RnwNpmPublish
variables:
publishCommitId: $[ dependencies.RnwNpmPublish.outputs['updateVersionTask.publishCommitId'] ]
strategy:
matrix:
X64Debug:
Expand Down Expand Up @@ -90,13 +86,11 @@ jobs:

steps:

# The RnwNpmPublish task does this too before publishing the npm package,
# but when each slice checks out code, its not going to have those changes
# Sync to point where the version numbers have been updated
- task: CmdLine@2
displayName: Update version numbers to align with publishing version
inputs:
script: node ../.ado/bumpFileVersions.js
workingDirectory: vnext
script: git checkout $(publishCommitId)


- template: templates/npm-install-and-build.yml

Expand All @@ -115,20 +109,28 @@ jobs:


- job: RNWNuget
dependsOn: RnwNativeBuild
dependsOn:
- RnwNpmPublish
- RnwNativeBuild
displayName: React-Native-Windows Build and Publish Nuget
pool:
name: OE Standard Pool
variables:
publishCommitId: $[ dependencies.RnwNpmPublish.outputs['updateVersionTask.publishCommitId'] ]
npmVersion: $[ dependencies.RnwNpmPublish.outputs['updateVersionTask.npmVersion'] ]

steps:
- checkout: none #skip checking out the default repository resource

- task: DownloadBuildArtifacts@0
displayName: 'Download source Artifact'
# The commit tag in the nuspec requires that we use at least nuget 4.6
- task: NuGetToolInstaller@0
inputs:
artifactName: UpdatedPackageJson
downloadPath: $(System.DefaultWorkingDirectory)
versionSpec: '>=4.6.0'

- template: templates/prep-and-pack-nuget.yml
parameters:
publishCommitId: $(publishCommitId)
npmVersion: $(npmVersion)

- task: NuGetCommand@2
displayName: 'NuGet push'
Expand Down
20 changes: 5 additions & 15 deletions .ado/templates/prep-and-pack-nuget.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
parameters:
publishCommitId: '0'
npmVersion: '0.0.1-pr'

steps:
- task: DownloadBuildArtifacts@0
Expand Down Expand Up @@ -50,23 +53,10 @@ steps:
robocopy $(System.DefaultWorkingDirectory)\ReactWindows-debug-arm $(System.DefaultWorkingDirectory)\NugetRoot\target\arm\debug /E /MOVE /NP
robocopy $(System.DefaultWorkingDirectory)\ReactWindows-ship-arm $(System.DefaultWorkingDirectory)\NugetRoot\target\arm\ship /E /MOVE /NP

- task: PowerShell@2
displayName: Extract version from package.json, and put it in nuspec
inputs:
targetType: inline # filePath | inline
script: |
if (Test-Path $env:SYSTEM_DEFAULTWORKINGDIRECTORY/UpdatedPackageJson/package.json) {
$lines = Get-Content $env:SYSTEM_DEFAULTWORKINGDIRECTORY/UpdatedPackageJson/package.json | Where {$_ -match '^\s*"version":.*'}
$npmVersion = $lines.Trim().Split()[1].Trim('",');
} else {
$npmVersion = "0.0.1-pr"
}
(Get-Content $env:SYSTEM_DEFAULTWORKINGDIRECTORY/NugetRoot/ReactWin32.nuspec).replace('__BuildBuildNumber__', $npmVersion) | Set-Content $env:SYSTEM_DEFAULTWORKINGDIRECTORY/NugetRoot/ReactWin32.nuspec
(Get-Content $env:SYSTEM_DEFAULTWORKINGDIRECTORY/NugetRoot/ReactUwp.nuspec).replace('__BuildBuildNumber__', $npmVersion) | Set-Content $env:SYSTEM_DEFAULTWORKINGDIRECTORY/NugetRoot/ReactUwp.nuspec

- task: NuGetCommand@2
displayName: 'NuGet pack'
inputs:
command: pack
packagesToPack: '$(System.DefaultWorkingDirectory)/NugetRoot/React*.nuspec'
packDestination: '$(System.DefaultWorkingDirectory)/NugetRoot/'
packDestination: '$(System.DefaultWorkingDirectory)/NugetRoot/'
buildProperties: CommitId=${{parameters.publishCommitId}};npmVersion=${{parameters.npmVersion}}
2 changes: 1 addition & 1 deletion .ado/templates/vs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ steps:
feedsToUse: config
#vstsFeed: # Required when feedsToUse == Select
#includeNuGetOrg: true # Required when feedsToUse == Select
nugetConfigPath: vnext/NuGet.config
nugetConfigPath: vnext/NuGet.config
#externalFeedCredentials: # Optional
#noCache: false
#disableParallelProcessing: false
Expand Down
5 changes: 5 additions & 0 deletions .ado/updateVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ function updateVersion() {
exec(`git push origin HEAD:${tempPublishBranch} --follow-tags --verbose`);
exec(`git push origin tag ${tagName}`);

// Record the updated npmVersion and commitId so that later build tasks can use it (to record in the nuget for instance)
const publishCommitId = execSync(`git rev-list -n 1 ${tagName}`);
console.log(`##vso[task.setvariable variable=publishCommitId;isOutput=true]${publishCommitId}`);
console.log(`##vso[task.setvariable variable=npmVersion;isOutput=true]${releaseVersion}`);

exec(`git checkout ${publishBranchName}`);
exec(`git pull origin ${publishBranchName}`);
exec(`git merge ${tempPublishBranch} --no-edit`);
Expand Down
5 changes: 5 additions & 0 deletions .ado/windows-vs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,9 @@ jobs:
steps:
- checkout: none #skip checking out the default repository resource

# The commit tag in the nuspec requires that we use at least nuget 4.6
- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=4.6.0'

- template: templates/prep-and-pack-nuget.yml
5 changes: 4 additions & 1 deletion vnext/ReactUwp.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>OfficeReact.Uwp</id>
<version>__BuildBuildNumber__</version>
<version>$npmVersion$</version>
<description>Contains Windows Implementation of React-Native</description>
<authors>Microsoft</authors>
<projectUrl>https://office.visualstudio.com/ISS/_git/sdx-platform</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<repository type="git"
url="https://github.com/microsoft/react-native-windows.git"
commit="$CommitId$" />
</metadata>
<files>
<file src="inc\cxxreact\*" target="inc\cxxreact"/>
Expand Down
5 changes: 4 additions & 1 deletion vnext/ReactWin32.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>OfficeReact.Win32</id>
<version>__BuildBuildNumber__</version>
<version>$npmVersion$</version>
<description>Contains Windows Implementation of React-Native</description>
<authors>Microsoft</authors>
<projectUrl>https://office.visualstudio.com/ISS/_git/sdx-platform</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<repository type="git"
url="https://github.com/microsoft/react-native-windows.git"
commit="$CommitId$" />
</metadata>
<files>
<file src="target\x86\Debug\React.Windows.Desktop.DLL\react-native-win32.*" target="lib\debug\x86" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
Expand Down
2 changes: 1 addition & 1 deletion vnext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"preinstall": "node Scripts/preInstall.js",
"postinstall": "node Scripts/postInstall.js",
"build": "just-scripts build",
"clean": "node Scripts/just.js clean",
"clean": "just-scripts clean",
"start": "node Scripts/cli.js start",
"watch": "node node_modules/@office-iss/sdx-build-tools/watch.js"
},
Expand Down