2019-04-02 07:23:40 +03:00
|
|
|
# This file defines the build steps to publish a release
|
2019-03-08 01:57:21 +03:00
|
|
|
name: $(Date:yyyyMMdd).$(Rev:.r)
|
|
|
|
|
2019-04-02 07:23:40 +03:00
|
|
|
trigger:
|
2019-05-01 20:08:31 +03:00
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
2019-05-03 01:59:22 +03:00
|
|
|
- fabric
|
2019-05-01 20:10:37 +03:00
|
|
|
paths:
|
|
|
|
exclude:
|
|
|
|
- package.json
|
2019-03-08 01:57:21 +03:00
|
|
|
|
2019-04-02 07:23:40 +03:00
|
|
|
pr: none
|
2019-03-08 01:57:21 +03:00
|
|
|
|
|
|
|
jobs:
|
2020-04-03 21:57:49 +03:00
|
|
|
- job: RNGithubNpmJSPublish
|
|
|
|
displayName: React-Native GitHub Publish to npmjs.org
|
|
|
|
pool:
|
|
|
|
vmImage: vs2017-win2016
|
|
|
|
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
|
|
|
|
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
|
|
|
|
steps:
|
|
|
|
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
|
|
|
|
clean: true # whether to fetch clean each time
|
|
|
|
# fetchDepth: 2 # the depth of commits to ask Git to fetch
|
|
|
|
lfs: false # whether to download Git-LFS files
|
|
|
|
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
|
|
|
|
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
|
|
|
|
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: npm install
|
|
|
|
inputs:
|
|
|
|
script: npm install
|
|
|
|
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Bump package version
|
|
|
|
inputs:
|
|
|
|
script: node .ado/bumpFileVersions.js
|
|
|
|
|
|
|
|
- task: Npm@1
|
2020-05-29 23:12:50 +03:00
|
|
|
displayName: "Publish latest react-native-macos to npmjs.org"
|
2020-04-03 21:57:49 +03:00
|
|
|
inputs:
|
|
|
|
command: 'publish'
|
|
|
|
publishEndpoint: 'npmjs'
|
2020-05-29 23:12:50 +03:00
|
|
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
|
|
|
|
|
|
|
- task: Npm@1
|
|
|
|
displayName: "Publish stable react-native-macos to npmjs.org"
|
|
|
|
inputs:
|
|
|
|
command: 'custom'
|
|
|
|
customCommand: publish --tag $(Build.SourceBranchName)
|
|
|
|
publishEndpoint: 'npmjs'
|
|
|
|
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master'))
|
2020-04-03 21:57:49 +03:00
|
|
|
|
2020-05-05 00:51:36 +03:00
|
|
|
- task: CmdLine@2
|
2020-05-05 06:59:05 +03:00
|
|
|
displayName: 'Tag published release'
|
2020-05-05 00:51:36 +03:00
|
|
|
inputs:
|
2020-05-05 06:59:05 +03:00
|
|
|
script: node .ado/gitTagRelease.js
|
2020-05-05 00:51:36 +03:00
|
|
|
env:
|
|
|
|
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
|
|
|
|
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
|
|
|
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
|
|
githubApiToken: $(githubApiToken)
|
|
|
|
|
|
|
|
|
2020-04-04 08:54:36 +03:00
|
|
|
- job: RNMacOSInitNpmJSPublish
|
|
|
|
displayName: react-native-macos-init Publish to npmjs.org
|
|
|
|
pool:
|
|
|
|
vmImage: vs2017-win2016
|
|
|
|
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
|
|
|
|
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
|
|
|
|
steps:
|
|
|
|
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
|
|
|
|
clean: true # whether to fetch clean each time
|
|
|
|
# fetchDepth: 2 # the depth of commits to ask Git to fetch
|
|
|
|
lfs: false # whether to download Git-LFS files
|
|
|
|
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
|
|
|
|
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
|
|
|
|
|
2020-04-05 03:04:33 +03:00
|
|
|
- template: templates/configure-git.yml
|
|
|
|
|
2020-04-04 08:54:36 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: yarn install
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
cd packages/react-native-macos-init
|
|
|
|
yarn install
|
|
|
|
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: yarn build
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
cd packages/react-native-macos-init
|
|
|
|
yarn build
|
|
|
|
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: "Publish react-native-macos-init to npmjs.org"
|
|
|
|
inputs:
|
|
|
|
script: |
|
2020-05-19 00:30:07 +03:00
|
|
|
npx beachball publish --branch origin/$(Build.SourceBranchName) -n $(npmAuthToken) -yes -m "applying package updates ***NO_CI***" --access public
|
2020-04-04 08:54:36 +03:00
|
|
|
|
2020-04-03 21:57:49 +03:00
|
|
|
- job: RNGithubOfficePublish
|
|
|
|
displayName: React-Native GitHub Publish to Office
|
2019-03-08 01:57:21 +03:00
|
|
|
pool:
|
2020-06-18 19:51:53 +03:00
|
|
|
vmImage: ubuntu-18.04
|
2019-03-08 01:57:21 +03:00
|
|
|
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
|
|
|
|
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
|
|
|
|
steps:
|
|
|
|
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
|
|
|
|
clean: true # whether to fetch clean each time
|
2019-06-04 21:32:35 +03:00
|
|
|
# fetchDepth: 2 # the depth of commits to ask Git to fetch
|
2019-03-08 01:57:21 +03:00
|
|
|
lfs: false # whether to download Git-LFS files
|
|
|
|
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
|
|
|
|
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
|
|
|
|
|
2020-06-18 19:51:53 +03:00
|
|
|
- task: UseNode@1
|
|
|
|
inputs:
|
|
|
|
version: '12.x'
|
|
|
|
|
2020-03-19 04:20:08 +03:00
|
|
|
- template: templates/apple-droid-node-patching.yml
|
|
|
|
parameters:
|
|
|
|
apply_office_patches: true
|
|
|
|
|
2020-06-18 19:51:53 +03:00
|
|
|
# This is currently required as the command task (strangely) always runs elevated ..
|
|
|
|
# which makes all the files touched by the above patching step unreadable by following non-command tasks without sudo.
|
|
|
|
# This makes all the files readable.
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: chmod
|
|
|
|
inputs:
|
|
|
|
script: chmod -R +r .
|
|
|
|
|
|
|
|
# Install NuGet
|
|
|
|
- task: CmdLine@2
|
2019-12-06 02:24:19 +03:00
|
|
|
inputs:
|
2020-06-18 19:51:53 +03:00
|
|
|
script: mkdir $(System.DefaultWorkingDirectory)/nuget-bin/ && curl -o $(System.DefaultWorkingDirectory)/nuget-bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
|
|
|
|
continueOnError: true
|
2019-12-06 02:24:19 +03:00
|
|
|
|
2020-05-02 08:28:16 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: "Rename package to react-native"
|
|
|
|
inputs:
|
|
|
|
script: node .ado/renamePackageForOffice.js
|
|
|
|
|
2019-03-08 01:57:21 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: npm install
|
|
|
|
inputs:
|
|
|
|
script: npm install
|
|
|
|
|
2019-06-13 01:35:43 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Bump package version
|
|
|
|
inputs:
|
2020-05-02 08:28:16 +03:00
|
|
|
script: node .ado/bumpOfficeFileVersions.js
|
2019-06-13 01:35:43 +03:00
|
|
|
|
2020-06-11 19:50:46 +03:00
|
|
|
- task: CmdLine@2
|
2019-06-11 15:06:59 +03:00
|
|
|
displayName: gradlew installArchives
|
2020-06-18 19:51:53 +03:00
|
|
|
inputs:
|
|
|
|
script: ./gradlew installArchives -Pparam="excludeLibs"
|
2019-03-08 01:57:21 +03:00
|
|
|
|
2019-05-23 09:29:51 +03:00
|
|
|
- template: templates\prep-android-nuget.yml
|
2019-05-21 21:29:56 +03:00
|
|
|
|
2020-06-18 19:51:53 +03:00
|
|
|
# Very similar to the default pack task .. but appends 'ndk21b' to the nuget pack version
|
|
|
|
- task: CmdLine@2
|
2019-05-21 21:29:56 +03:00
|
|
|
displayName: 'NuGet pack'
|
|
|
|
inputs:
|
2020-06-18 19:51:53 +03:00
|
|
|
script: OUTPUT_DIR=$(Build.StagingDirectory)/final;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 $OUTPUT_DIR -Properties buildNumber=$(buildNumber)-$NDK;commitId=$(Build.SourceVersion)
|
2019-06-11 15:06:59 +03:00
|
|
|
|
2020-05-05 06:59:05 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: 'Npm pack'
|
|
|
|
inputs:
|
|
|
|
script: node .ado/npmOfficePack.js
|
|
|
|
env:
|
|
|
|
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
|
2020-06-30 19:56:54 +03:00
|
|
|
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
|
2020-05-05 06:59:05 +03:00
|
|
|
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
|
|
|
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
|
|
githubApiToken: $(githubApiToken)
|
|
|
|
|
2019-07-30 22:29:46 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish final artifacts'
|
2019-06-11 15:06:59 +03:00
|
|
|
inputs:
|
2019-07-31 20:25:45 +03:00
|
|
|
PathtoPublish: '$(Build.StagingDirectory)\final'
|
2020-06-18 19:51:53 +03:00
|
|
|
ArtifactName: 'ReactNative-Final'
|