Merge pull request #1297 from rasaha91/error-nuget

Escape semi-colon in bash command
This commit is contained in:
rasaha91 2022-07-27 23:47:53 -07:00 коммит произвёл Ranesh Saha
Родитель 8ed7f2934d
Коммит dfebc17736
3 изменённых файлов: 17 добавлений и 18 удалений

Просмотреть файл

@ -31,21 +31,11 @@ jobs:
- template: templates/android-build-office.yml - template: templates/android-build-office.yml
- template: templates/prep-android-nuget.yml
- template: templates/download-android-dependencies.yml - template: templates/download-android-dependencies.yml
parameters: parameters:
artifact_feed: react-native/react-native-public artifact_feed: react-native/react-native-public
# Very similar to the default pack task .. but appends 'ndk21' to the nuget pack version - template: templates/android-nuget-pack.yml
- task: CmdLine@2
displayName: 'Verify NuGet can be packed'
inputs:
script: NDK=ndk`cat ${ANDROID_SDK_ROOT}/ndk-bundle/source.properties 2>&1 | grep Pkg.Revision | awk '{ print $3}' | awk -F. '{ print $1 }'`; mono $(System.DefaultWorkingDirectory)/nuget-bin/nuget.exe pack $(System.DefaultWorkingDirectory)/ReactAndroid/ReactAndroid.nuspec -OutputDirectory $(Build.StagingDirectory)/final -Properties buildNumber=$(buildNumber)-$NDK;commitId=$(Build.SourceVersion)
# Android CI doesn't create a nuget now, but this check is failing builds. Quickest fix to unblock builds is to disable the check... but we need to find the root cause and fix it and enable this again.
# - script: '[ -f $(System.DefaultWorkingDirectory)/*.nupkg ]'
# displayName: Verify that NuGet was actually created
- task: CmdLine@2 - task: CmdLine@2
displayName: 'Npm pack' displayName: 'Npm pack'

Просмотреть файл

@ -208,18 +208,12 @@ jobs:
inputs: inputs:
script: node .ado/removeWorkspaceConfig.js script: node .ado/removeWorkspaceConfig.js
- template: templates/prep-android-nuget.yml
# Enumerate and download all dependencies .. # Enumerate and download all dependencies ..
- template: templates/download-android-dependencies.yml - template: templates/download-android-dependencies.yml
parameters: parameters:
artifact_feed: Office artifact_feed: Office
# Very similar to the default pack task .. but appends 'ndk21b' to the nuget pack version - template: templates/android-nuget-pack.yml
- task: CmdLine@2
displayName: 'NuGet pack'
inputs:
script: NDK=ndk`cat ${ANDROID_SDK_ROOT}/ndk-bundle/source.properties 2>&1 | grep Pkg.Revision | awk '{ print $3}' | awk -F. '{ print $1 }'`; mono $(System.DefaultWorkingDirectory)/nuget-bin/nuget.exe pack $(System.DefaultWorkingDirectory)/ReactAndroid/ReactAndroid.nuspec -OutputDirectory $(Build.StagingDirectory)/final -Properties buildNumber=$(buildNumber)-$NDK;commitId=$(Build.SourceVersion)
- task: CmdLine@2 - task: CmdLine@2
displayName: 'Npm pack' displayName: 'Npm pack'

Просмотреть файл

@ -0,0 +1,15 @@
steps:
- task: PowerShell@2
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('",');
echo "##vso[task.setvariable variable=buildNumber]$npmVersion"
# Very similar to the default pack task .. but appends 'ndk21b' to the nuget pack version
- task: CmdLine@2
displayName: 'NuGet pack'
inputs:
script: NDK=ndk`cat ${ANDROID_SDK_ROOT}/ndk-bundle/source.properties 2>&1 | grep Pkg.Revision | awk '{ print $3}' | awk -F. '{ print $1 }'`; mono $(System.DefaultWorkingDirectory)/nuget-bin/nuget.exe pack $(System.DefaultWorkingDirectory)/ReactAndroid/ReactAndroid.nuspec -OutputDirectory $(Build.StagingDirectory)/final -Properties buildNumber=$(buildNumber)-$NDK\;commitId=$(Build.SourceVersion)