File tree Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 24
24
- task : UseNode@1
25
25
inputs :
26
26
version : ' 10.x'
27
+
28
+ # Install NuGet v4.6.4+
29
+ - task : NuGetToolInstaller@1
30
+ inputs :
31
+ versionSpec : ' >=4.6.4'
27
32
28
33
- task : CmdLine@2
29
34
displayName : npm install
@@ -112,6 +117,7 @@ jobs:
112
117
command : pack
113
118
packagesToPack : ' ReactAndroid/ReactAndroid.nuspec'
114
119
packDestination : ' $(System.DefaultWorkingDirectory)'
120
+ buildProperties : buildNumber=$(buildNumber);commitId=$(Build.SourceVersion)
115
121
116
122
- task : Gradle@1
117
123
displayName : gradlew clean
Original file line number Diff line number Diff line change 28
28
submodules : recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
29
29
persistCredentials : true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
30
30
31
+ # Install NuGet v4.6.4+
32
+ - task : NuGetToolInstaller@1
33
+ inputs :
34
+ versionSpec : ' >=4.6.4'
35
+
31
36
- task : CmdLine@2
32
37
displayName : npm install
33
38
inputs :
@@ -110,6 +115,7 @@ jobs:
110
115
command : pack
111
116
packagesToPack : ' ReactAndroid/ReactAndroid.nuspec'
112
117
packDestination : ' $(Build.StagingDirectory)\final'
118
+ buildProperties : buildNumber=$(buildNumber);commitId=$(Build.SourceVersion)
113
119
114
120
- task : CmdLine@2
115
121
displayName : Do Publish
Original file line number Diff line number Diff line change 1
1
steps :
2
2
- task : PowerShell@2
3
- displayName : Extract version from package.json, and put it in nuspec
3
+ displayName : Extract version from package.json, and put it in `buildNumber` variable
4
4
inputs :
5
5
targetType : inline # filePath | inline
6
6
script : |
7
7
$lines = Get-Content package.json | Where {$_ -match '^\s*"version":.*'}
8
8
$npmVersion = $lines.Trim().Split()[1].Trim('",');
9
- (Get-Content ReactAndroid/ReactAndroid.nuspec).replace('__BuildBuildNumber__', $npmVersion) | Set-Content ReactAndroid/ReactAndroid.nuspec
9
+ echo "##vso[task.setvariable variable=buildNumber] $npmVersion"
10
10
11
11
# Pretty yucky - but we dont want devmain to have to update versions _all_ over the place
12
12
- task : PowerShell@2
Original file line number Diff line number Diff line change 2
2
<package xmlns =" http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd" >
3
3
<metadata >
4
4
<id >OfficeReact.Android</id >
5
- <version >__BuildBuildNumber__ </version >
5
+ <version >$buildNumber$ </version >
6
6
<description >Contains Android Implementation of React-Native</description >
7
7
<authors >Microsoft</authors >
8
8
<projectUrl >https://github.com/microsoft/react-native</projectUrl >
9
+ <repository type =" git" url =" https://github.com/microsoft/react-native.git" commit =" $commitId$" />
9
10
<requireLicenseAcceptance >false</requireLicenseAcceptance >
10
11
</metadata >
11
12
You can’t perform that action at this time.
0 commit comments