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

160 строки
6.8 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)
2019-04-02 07:23:40 +03:00
trigger:
batch: true
branches:
include:
- master
- '*-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
# It is expected that a `latestStableBranch` variable is set in the pipeline's settings:
# https://dev.azure.com/ms/react-native/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=221
variables:
${{ if eq(variables['Build.SourceBranchName'], variables['latestStableBranch']) }}:
npmDistTag: latest
${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
npmDistTag: canary
${{ if and(ne(variables['Build.SourceBranchName'], 'master'), ne(variables['Build.SourceBranchName'], variables['latestStableBranch'])) }}:
npmDistTag: v${{variables['Build.SourceBranchName']}}
2019-03-08 01:57:21 +03:00
jobs:
- 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 stable package version
inputs:
script: node .ado/bumpFileVersions.js
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
- task: CmdLine@2
displayName: Bump canary package version
inputs:
script: node scripts/bump-oss-version.js --nightly
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
2020-09-03 11:50:35 +03:00
- script: npm publish --tag ${{variables.npmDistTag}} --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmAuthToken)
displayName: Publish ${{variables.npmDistTag}} react-native-macos to npmjs.org
- task: CmdLine@2
displayName: 'Tag published release'
inputs:
script: node .ado/gitTagRelease.js
env:
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
- 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
condition: eq(variables['Build.SourceBranchName'], 'master')
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: templates/configure-git.yml
- 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: |
npx beachball publish --branch origin/$(Build.SourceBranchName) -n $(npmAuthToken) -yes -m "applying package updates ***NO_CI***" --access public
- job: RNGithubOfficePublish
displayName: React-Native GitHub Publish to Office
2019-03-08 01:57:21 +03:00
pool:
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
- template: templates/android-build-office.yml
2019-03-08 01:57:21 +03:00
- task: CmdLine@2
displayName: Bump package version
inputs:
script: node .ado/bumpOfficeFileVersions.js
- task: CmdLine@2
displayName: gradlew installArchives
inputs:
2020-08-18 08:01:55 +03:00
script: REACT_NATIVE_DEPENDENCIES=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs"
2019-03-08 01:57:21 +03:00
- template: templates\prep-android-nuget.yml
2019-05-21 21:29:56 +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-08-19 00:18:42 +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 $(System.DefaultWorkingDirectory) -Properties buildNumber=$(buildNumber)-$NDK;commitId=$(Build.SourceVersion)
- task: CmdLine@2
displayName: 'Npm pack'
inputs:
script: node .ado/npmOfficePack.js
env:
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)
- task: PublishBuildArtifacts@1
displayName: 'Publish final artifacts'
inputs:
PathtoPublish: '$(Build.StagingDirectory)/final'
ArtifactName: 'ReactNative-Final'