30
30
value : true
31
31
timeoutInMinutes : 90 # how long to run the job before automatically cancelling
32
32
cancelTimeoutInMinutes : 5 # how much time to give 'run always even if cancelled tasks' before killing them
33
+ dependsOn :
34
+ - Compliance
33
35
steps :
34
36
- checkout : self # self represents the repo where the initial Pipelines YAML file was found
35
37
clean : true # whether to fetch clean each time
@@ -38,11 +40,16 @@ jobs:
38
40
submodules : recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
39
41
persistCredentials : true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
40
42
41
- - ${{ if eq(variables['isMain'], true) }} :
43
+ # Setup the repo to be ready for release. This includes:
44
+ # - Autogenerating the next version number
45
+ # - Calling the approprate scripts that upstream React Native uses to prepare a release
46
+ # - Skipping the actual `git tag`, `git push`, and `npm publish steps as we do that here instead
47
+
48
+ - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }} :
42
49
- template : templates/apple-job-publish.yml
43
50
parameters :
44
51
build_type : nightly
45
- - ${{ elseif eq (variables['isReleaseBranch '], true ) }} :
52
+ - ${{ elseif endsWith (variables['Build.SourceBranchName '], '-stable' ) }} :
46
53
- template : templates/apple-job-publish.yml
47
54
parameters :
48
55
build_type : release
54
61
echo "Skipping publish for branch $(Build.SourceBranchName)"
55
62
exit 1
56
63
64
+ # Generate and publish the SBOM
65
+
57
66
- task : AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
58
67
displayName : 📒 Generate Manifest
59
68
inputs :
65
74
artifactName : SBom-RNGithubNpmJSPublish-$(System.JobAttempt)
66
75
targetPath : $(System.DefaultWorkingDirectory)/_manifest
67
76
77
+ # Set the NPM dist-tag and do the actual NPM publish
78
+
79
+ - bash : echo "##vso[task.setvariable variable=npmDistTag]latest"
80
+ displayName : Set dist-tag to latest
81
+ condition : eq(variables['Build.SourceBranchName'], variables.latestStableBranch)
82
+
83
+ - bash : echo "##vso[task.setvariable variable=npmDistTag]canary"
84
+ displayName : Set dist-tag to canary
85
+ condition : eq(variables['Build.SourceBranchName'], 'main')
86
+
87
+ - bash : echo "##vso[task.setvariable variable=npmDistTag]v${{variables['Build.SourceBranchName']}}"
88
+ displayName : Set dist-tag to v0.x-stable
89
+ condition : and(ne(variables['Build.SourceBranchName'], 'main'), ne(variables['Build.SourceBranchName'], variables.latestStableBranch))
90
+
91
+ - task : CmdLine@2
92
+ displayName : Actual NPM Publish
93
+ inputs :
94
+ script : |
95
+ npm publish --tag $(npmDistTag) --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmAuthToken)
96
+
97
+ # Set the git tag and push the version update back to Github
98
+
99
+ - template : templates/configure-git.yml
100
+
101
+ - task : CmdLine@2
102
+ displayName : ' Tag and push to Github'
103
+ inputs :
104
+ script : node .ado/gitTagRelease.js
105
+ env :
106
+ BUILD_STAGINGDIRECTORY : $(Build.StagingDirectory)
107
+ BUILD_SOURCEBRANCH : $(Build.SourceBranch)
108
+ SYSTEM_ACCESSTOKEN : $(System.AccessToken)
109
+ githubAuthToken : $(githubAuthToken)
110
+ condition : and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))
111
+
112
+
68
113
- job : RNMacOSInitNpmJSPublish
69
114
displayName : NPM Publish react-native-macos-init
70
115
pool : cxeiss-ubuntu-20-04-large
83
128
84
129
- template : templates/apple-install-dependencies.yml
85
130
86
- - template : templates/apple-release-setup .yml
131
+ - template : templates/configure-git .yml
87
132
88
133
- task : CmdLine@2
89
134
displayName : Build react-native-macos-init
0 commit comments