2020-09-08 15:47:06 +03:00
|
|
|
# It is expected that a `latestStableBranch` variable is set in the pipeline's settings:
|
2022-03-04 08:40:53 +03:00
|
|
|
# https://dev.azure.com/office/ISS/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=18541
|
2020-09-08 15:47:06 +03:00
|
|
|
|
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)
|
|
|
|
|
2022-02-04 19:37:15 +03:00
|
|
|
trigger:
|
2019-05-01 20:08:31 +03:00
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
2022-01-07 00:24:34 +03:00
|
|
|
- main
|
2020-09-01 16:40:54 +03:00
|
|
|
- '*-stable'
|
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
|
|
|
|
2021-11-01 22:33:19 +03:00
|
|
|
variables:
|
2022-02-04 19:37:15 +03:00
|
|
|
- template: variables/vars.yml
|
2022-03-04 08:40:53 +03:00
|
|
|
- group: React-native-macos Secrets
|
|
|
|
- group: InfoSec-SecurityResults
|
|
|
|
- name: tags
|
|
|
|
value: production,externalfacing
|
2021-11-01 22:33:19 +03:00
|
|
|
|
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:
|
2022-02-04 19:37:15 +03:00
|
|
|
vmImage: $(VmImageApple)
|
2022-03-04 08:40:53 +03:00
|
|
|
variables:
|
|
|
|
- name: BUILDSECMON_OPT_IN
|
|
|
|
value: true
|
2020-04-03 21:57:49 +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
|
2022-03-04 08:40:53 +03:00
|
|
|
dependsOn:
|
|
|
|
- Compliance
|
2020-04-03 21:57:49 +03:00
|
|
|
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-09-08 15:47:06 +03:00
|
|
|
- script: exit 1
|
|
|
|
displayName: Validate variables
|
|
|
|
condition: eq(variables.latestStableBranch, '')
|
|
|
|
|
2020-09-08 20:09:19 +03:00
|
|
|
- bash: echo "##vso[task.setvariable variable=npmDistTag]latest"
|
2020-09-08 15:47:06 +03:00
|
|
|
displayName: Set dist-tag to latest
|
|
|
|
condition: eq(variables['Build.SourceBranchName'], variables.latestStableBranch)
|
|
|
|
|
2020-09-08 20:09:19 +03:00
|
|
|
- bash: echo "##vso[task.setvariable variable=npmDistTag]canary"
|
2020-09-08 15:47:06 +03:00
|
|
|
displayName: Set dist-tag to canary
|
2022-01-07 00:24:34 +03:00
|
|
|
condition: eq(variables['Build.SourceBranchName'], 'main')
|
2020-09-08 15:47:06 +03:00
|
|
|
|
2020-09-08 20:09:19 +03:00
|
|
|
- bash: echo "##vso[task.setvariable variable=npmDistTag]v${{variables['Build.SourceBranchName']}}"
|
2020-09-08 15:47:06 +03:00
|
|
|
displayName: Set dist-tag to v0.x-stable
|
2022-01-07 00:24:34 +03:00
|
|
|
condition: and(ne(variables['Build.SourceBranchName'], 'main'), ne(variables['Build.SourceBranchName'], variables.latestStableBranch))
|
2020-09-08 15:47:06 +03:00
|
|
|
|
2021-11-01 22:33:19 +03:00
|
|
|
- template: templates/apple-node-setup.yml
|
|
|
|
|
2020-04-03 21:57:49 +03:00
|
|
|
- task: CmdLine@2
|
2021-09-28 22:44:35 +03:00
|
|
|
displayName: yarn install
|
2020-04-03 21:57:49 +03:00
|
|
|
inputs:
|
2021-09-28 22:44:35 +03:00
|
|
|
script: yarn install --frozen-lockfile
|
2020-04-03 21:57:49 +03:00
|
|
|
|
|
|
|
- task: CmdLine@2
|
2020-09-01 21:17:56 +03:00
|
|
|
displayName: Bump stable package version
|
2020-04-03 21:57:49 +03:00
|
|
|
inputs:
|
|
|
|
script: node .ado/bumpFileVersions.js
|
2022-01-07 00:24:34 +03:00
|
|
|
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))
|
2021-11-01 22:33:19 +03:00
|
|
|
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: pod update React-TurboModuleCxx-RNW
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
cd packages/rn-tester
|
|
|
|
pod update React-TurboModuleCxx-RNW
|
2022-01-07 00:24:34 +03:00
|
|
|
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))
|
2020-09-01 21:17:56 +03:00
|
|
|
|
|
|
|
- task: CmdLine@2
|
2020-09-02 20:23:13 +03:00
|
|
|
displayName: Bump canary package version
|
2020-09-01 21:17:56 +03:00
|
|
|
inputs:
|
2022-01-27 04:56:03 +03:00
|
|
|
script: node scripts/bump-oss-version.js --nightly --autogenerateVersionNumber
|
2022-01-07 00:24:34 +03:00
|
|
|
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'main'))
|
2020-04-03 21:57:49 +03:00
|
|
|
|
2021-10-29 01:15:33 +03:00
|
|
|
# Publish will fail if package.json is marked as private
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Remove workspace config from package.json
|
|
|
|
inputs:
|
|
|
|
script: node .ado/removeWorkspaceConfig.js
|
|
|
|
|
2022-02-11 07:37:20 +03:00
|
|
|
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
|
|
|
displayName: 📒 Generate Manifest
|
|
|
|
inputs:
|
|
|
|
BuildDropPath: $(System.DefaultWorkingDirectory)
|
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
displayName: 📒 Publish Manifest
|
|
|
|
inputs:
|
|
|
|
artifactName: SBom-RNGithubNpmJSPublish-$(System.JobAttempt)
|
|
|
|
targetPath: $(System.DefaultWorkingDirectory)/_manifest
|
|
|
|
|
2020-09-08 15:47:06 +03:00
|
|
|
- script: npm publish --tag $(npmDistTag) --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmAuthToken)
|
|
|
|
displayName: Publish react-native-macos to npmjs.org
|
2020-04-03 21:57:49 +03:00
|
|
|
|
2021-10-29 01:15:33 +03:00
|
|
|
# Put the private flag back so that the removal does not get committed by the tag release step
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Restore package.json workspace config
|
|
|
|
inputs:
|
|
|
|
script: node .ado/restoreWorkspaceConfig.js
|
|
|
|
|
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)
|
2022-03-04 08:40:53 +03:00
|
|
|
githubApiToken: $(githubAuthToken)
|
2022-01-07 00:24:34 +03:00
|
|
|
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))
|
2020-05-05 00:51:36 +03:00
|
|
|
|
|
|
|
|
2020-04-04 08:54:36 +03:00
|
|
|
- job: RNMacOSInitNpmJSPublish
|
|
|
|
displayName: react-native-macos-init Publish to npmjs.org
|
2022-03-04 08:40:53 +03:00
|
|
|
pool: Azure-Pipelines-EO-Ubuntu20.04-Office
|
2020-04-04 08:54:36 +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
|
2022-01-07 00:24:34 +03:00
|
|
|
condition: eq(variables['Build.SourceBranchName'], 'main')
|
2022-03-04 08:40:53 +03:00
|
|
|
dependsOn:
|
|
|
|
- Compliance
|
2020-04-04 08:54:36 +03:00
|
|
|
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
|
|
|
|
|
2022-03-04 08:40:53 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Code tested in other pipeline [test]
|
|
|
|
inputs:
|
|
|
|
script: echo "This code is tested as part of an integration test. See the 'Verify react-native-macos-init' task."
|
|
|
|
|
2020-04-04 08:54:36 +03:00
|
|
|
- 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
|
|
|
|
2022-02-11 07:37:20 +03:00
|
|
|
# beachball modifies the package.json files so run manifest generation after it.
|
|
|
|
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
|
|
|
displayName: 📒 Generate Manifest
|
|
|
|
inputs:
|
|
|
|
BuildDropPath: $(System.DefaultWorkingDirectory)
|
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
displayName: 📒 Publish Manifest
|
|
|
|
inputs:
|
|
|
|
artifactName: SBom-RNMacOSInitNpmJSPublish-$(System.JobAttempt)
|
|
|
|
targetPath: $(System.DefaultWorkingDirectory)/_manifest
|
|
|
|
|
2020-04-03 21:57:49 +03:00
|
|
|
- job: RNGithubOfficePublish
|
|
|
|
displayName: React-Native GitHub Publish to Office
|
2022-03-04 08:40:53 +03:00
|
|
|
pool: Azure-Pipelines-EO-Ubuntu20.04-Office
|
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
|
2022-03-04 08:40:53 +03:00
|
|
|
dependsOn:
|
|
|
|
- Compliance
|
2019-03-08 01:57:21 +03:00
|
|
|
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-08-19 00:00:49 +03:00
|
|
|
- template: templates/android-build-office.yml
|
2019-03-08 01:57:21 +03:00
|
|
|
|
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
|
|
|
|
2021-11-01 22:33:19 +03:00
|
|
|
# Publish will fail if package.json is marked as private
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Remove workspace config from package.json
|
|
|
|
inputs:
|
|
|
|
script: node .ado/removeWorkspaceConfig.js
|
|
|
|
|
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:
|
2020-10-28 19:54:15 +03:00
|
|
|
script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./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
|
|
|
|
2021-10-13 20:22:26 +03:00
|
|
|
# Enumerate and download all dependencies ..
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: 'Verify Dependencies can be enumerated'
|
|
|
|
inputs:
|
2022-03-03 20:19:34 +03:00
|
|
|
script: sudo apt-get install python3-pip && sudo apt-get install python3-setuptools && pip3 install BeautifulSoup4 && pip3 install wheel && pip3 install wget && python3 .ado/downloadAndroidDependencies.py $(Build.SourcesDirectory) && tree $(Build.SourcesDirectory)/android
|
2021-10-13 20:22:26 +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-09-03 19:13:10 +03:00
|
|
|
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)
|
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)
|
2022-03-04 08:40:53 +03:00
|
|
|
githubApiToken: $(githubAuthToken)
|
2020-05-05 06:59:05 +03:00
|
|
|
|
2022-02-11 07:37:20 +03:00
|
|
|
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
|
|
|
|
displayName: 📒 Generate Manifest
|
|
|
|
inputs:
|
|
|
|
BuildDropPath: $(Build.StagingDirectory)/final
|
|
|
|
|
2019-07-30 22:29:46 +03:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish final artifacts'
|
2019-06-11 15:06:59 +03:00
|
|
|
inputs:
|
2020-07-29 03:29:32 +03:00
|
|
|
PathtoPublish: '$(Build.StagingDirectory)/final'
|
2022-02-04 19:37:15 +03:00
|
|
|
ArtifactName: 'ReactNative-Final'
|
2022-03-04 08:40:53 +03:00
|
|
|
|
|
|
|
- job: Compliance
|
|
|
|
displayName: React-Native GitHub Compliance pipeline
|
|
|
|
pool: OE-OfficePublic
|
|
|
|
timeoutInMinutes: 15 # how long to run the job before automatically cancelling
|
|
|
|
steps:
|
|
|
|
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
|
|
|
|
clean: true # whether to fetch clean each time
|
|
|
|
fetchDepth: 10 # 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
|