react-native-macos/.ado/publish.yml

180 строки
7.7 KiB
YAML
Исходник Обычный вид История

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)
trigger:
batch: true
branches:
include:
- main
- '*-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
variables:
- template: /.ado/variables/vars.yml@self
2022-03-04 08:40:53 +03:00
- group: React-native-macos Secrets
- group: InfoSec-SecurityResults
- name: tags
value: production,externalfacing
# Remember to update this in previous stable branches when creating a new stable branch
- name : latestStableBranch
value: '0.75-stable'
resources:
repositories:
- repository: OfficePipelineTemplates
type: git
name: 1ESPipelineTemplates/OfficePipelineTemplates
ref: refs/tags/release
extends:
template: v1/Office.Official.PipelineTemplate.yml@OfficePipelineTemplates
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-latest
os: windows
sdl:
eslint:
configuration: 'recommended'
parser: '@typescript-eslint/parser'
parserOptions: ''
enableExclusions: true
# Justification: js files in this repo are flow files. the built-in eslint does not support this. Adding a separate step to run the sdl rules for flow files.
exclusionPatterns: '**/*.js'
credscan:
suppressionsFile: .ado/CredScanSuppressions.json
stages:
- stage: main
jobs:
- job: RNGithubNpmJSPublish
displayName: NPM Publish React-native-macos
pool:
name: Azure Pipelines
vmImage: macos-13
os: macOS
variables:
- name: BUILDSECMON_OPT_IN
value: true
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
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)
artifactName: github-npm-js-publish
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
# Setup the repo to be ready for release. This includes:
# - Autogenerating the next version number
# - Calling the approprate scripts that upstream React Native uses to prepare a release
# - Skipping the actual `git tag`, `git push`, and `npm publish steps as we do that here instead
2023-10-28 03:37:53 +03:00
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- template: .ado/templates/apple-steps-publish.yml@self
parameters:
build_type: nightly
- ${{ elseif endsWith(variables['Build.SourceBranchName'], '-stable') }}:
- template: .ado/templates/apple-steps-publish.yml@self
parameters:
build_type: release
- ${{ else }}:
- task: CmdLine@2
displayName: Unknown branch, skipping publish
inputs:
script: |
echo "Skipping publish for branch $(Build.SourceBranchName)"
exit 1
# Set the NPM dist-tag and do the actual NPM publish
- bash: echo "##vso[task.setvariable variable=npmDistTag]latest"
displayName: Set dist-tag to latest
condition: eq(variables['Build.SourceBranchName'], variables.latestStableBranch)
- bash: echo "##vso[task.setvariable variable=npmDistTag]canary"
displayName: Set dist-tag to canary
condition: eq(variables['Build.SourceBranchName'], 'main')
- bash: echo "##vso[task.setvariable variable=npmDistTag]v${{variables['Build.SourceBranchName']}}"
displayName: Set dist-tag to v0.x-stable
condition: and(ne(variables['Build.SourceBranchName'], 'main'), ne(variables['Build.SourceBranchName'], variables.latestStableBranch))
- task: CmdLine@2
displayName: Actual NPM Publish
inputs:
script: |
npm publish ./packages/react-native --tag $(npmDistTag) --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmAuthToken)
# Set the git tag and push the version update back to Github
- template: .ado/templates/configure-git.yml@self
- task: CmdLine@2
displayName: 'Tag and push to Github'
inputs:
script: node .ado/gitTagRelease.js
env:
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubAuthToken: $(githubAuthToken)
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))
- job: RNMacOSInitNpmJSPublish
displayName: NPM Publish beachball packages (e.g., react-native-macos-init)
pool:
name: cxeiss-ubuntu-20-04-large
image: cxe-ubuntu-20-04-1es-pt
os: linux
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
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)
artifactName: macos-init-npm-js-publish
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
- template: .ado/templates/configure-git.yml@self
- task: CmdLine@2
displayName: yarn install
inputs:
script: |
cd packages/react-native-macos-init
yarn install
- task: CmdLine@2
displayName: Build react-native-macos-init
inputs:
script: |
cd packages/react-native-macos-init
yarn build
- 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."
- task: CmdLine@2
displayName: "Publish beachball packages to npmjs.org"
inputs:
script: |
2023-12-28 00:51:15 +03:00
npx beachball publish --scope '!packages/react-native' --branch origin/$(Build.SourceBranchName) -n $(npmAuthToken) -yes -m "applying package updates ***NO_CI***" --access public