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
|
2023-04-03 21:06:17 +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:
|
2023-04-03 21:06:17 +03:00
|
|
|
- job: NPMPublishRNM
|
|
|
|
displayName: NPM Publish React Native macOS
|
2020-04-03 21:57:49 +03:00
|
|
|
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-29 12:13:43 +03:00
|
|
|
dependsOn:
|
2022-03-04 08:40:53 +03:00
|
|
|
- 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
|
|
|
|
|
2023-03-31 21:09:48 +03:00
|
|
|
- template: templates/apple-tools-setup.yml
|
2020-09-08 15:47:06 +03:00
|
|
|
|
2023-03-31 21:09:48 +03:00
|
|
|
- template: templates/apple-install-dependencies.yml
|
2020-09-08 15:47:06 +03:00
|
|
|
|
2023-03-31 21:09:48 +03:00
|
|
|
- template: templates/apple-release-setup.yml
|
2021-11-01 22:33:19 +03:00
|
|
|
|
2020-04-03 21:57:49 +03:00
|
|
|
- task: CmdLine@2
|
2023-03-31 21:09:48 +03:00
|
|
|
displayName: Set next version if release branch
|
2020-04-03 21:57:49 +03:00
|
|
|
inputs:
|
2023-03-31 21:09:48 +03:00
|
|
|
script: |
|
|
|
|
VERSION=$(node .ado/get-next-semver-version.js)
|
|
|
|
echo "Set version to: $VERSION"
|
2023-04-03 21:06:17 +03:00
|
|
|
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'))
|
|
|
|
|
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: Set latest tag if latest stable branch
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
LATEST=true
|
|
|
|
echo "Set latest to: $LATEST"
|
|
|
|
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'))
|
2020-04-03 21:57:49 +03:00
|
|
|
|
|
|
|
- task: CmdLine@2
|
2023-04-03 21:06:17 +03:00
|
|
|
displayName: Set release type to 'nightly'
|
2020-04-03 21:57:49 +03:00
|
|
|
inputs:
|
2023-03-31 21:09:48 +03:00
|
|
|
script: |
|
2023-04-03 21:06:17 +03:00
|
|
|
RELEASE_TYPE=nightly
|
2023-03-31 21:09:48 +03:00
|
|
|
echo "Set release type to: $RELEASE_TYPE"
|
2023-04-03 21:06:17 +03:00
|
|
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
|
2023-03-31 21:09:48 +03:00
|
|
|
|
2020-09-01 21:17:56 +03:00
|
|
|
- task: CmdLine@2
|
2023-04-03 21:06:17 +03:00
|
|
|
displayName: Set release type to 'release'
|
2020-09-01 21:17:56 +03:00
|
|
|
inputs:
|
2023-03-31 21:09:48 +03:00
|
|
|
script: |
|
2023-04-03 21:06:17 +03:00
|
|
|
RELEASE_TYPE=release
|
|
|
|
echo "Set release type to: $RELEASE_TYPE"
|
|
|
|
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'))
|
2020-04-03 21:57:49 +03:00
|
|
|
|
2021-10-29 01:15:33 +03:00
|
|
|
- task: CmdLine@2
|
2023-03-31 21:09:48 +03:00
|
|
|
displayName: Prepare package for release
|
2021-10-29 01:15:33 +03:00
|
|
|
inputs:
|
2023-03-31 21:09:48 +03:00
|
|
|
script: |
|
|
|
|
if [[ -z "$VERSION" ]]; then
|
|
|
|
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | head -1)
|
|
|
|
echo "Using the version from the package.json: $VERSION"
|
|
|
|
fi
|
|
|
|
node ./scripts/prepare-package-for-release.js -v "$VERSION" -l $LATEST
|
2023-04-03 21:06:17 +03:00
|
|
|
condition: and(succeeded(), ne(variables['Build.TargetBranch'], 'refs/heads/main'))
|
2021-10-29 01:15:33 +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: $(System.DefaultWorkingDirectory)
|
|
|
|
|
2023-03-31 21:09:48 +03:00
|
|
|
- task: CmdLine@2
|
|
|
|
displayName: NPM Publish
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
node ./scripts/publish-npm.js --$RELEASE_TYPE
|
|
|
|
|
2022-02-11 07:37:20 +03:00
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
displayName: 📒 Publish Manifest
|
|
|
|
inputs:
|
|
|
|
artifactName: SBom-RNGithubNpmJSPublish-$(System.JobAttempt)
|
|
|
|
targetPath: $(System.DefaultWorkingDirectory)/_manifest
|
|
|
|
|
2020-04-04 08:54:36 +03:00
|
|
|
- job: RNMacOSInitNpmJSPublish
|
|
|
|
displayName: react-native-macos-init Publish to npmjs.org
|
2022-08-02 04:02:02 +03:00
|
|
|
pool: cxeiss-ubuntu-20-04-large
|
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-29 12:13:43 +03:00
|
|
|
dependsOn:
|
2022-03-04 08:40:53 +03:00
|
|
|
- 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
|
|
|
|
|
2023-03-31 21:09:48 +03:00
|
|
|
- template: templates/apple-tools-setup.yml
|
2020-04-05 03:04:33 +03:00
|
|
|
|
2023-03-31 21:09:48 +03:00
|
|
|
- template: templates/apple-install-dependencies.yml
|
|
|
|
|
|
|
|
- template: templates/apple-release-setup.yml
|
2020-04-04 08:54:36 +03:00
|
|
|
|
|
|
|
- task: CmdLine@2
|
2023-03-31 21:09:48 +03:00
|
|
|
displayName: Build react-native-macos-init
|
2020-04-04 08:54:36 +03:00
|
|
|
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
|
|
|
|
|
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
|
2022-09-30 22:49:17 +03:00
|
|
|
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
|