diff --git a/.ado/jobs/npm-publish-dry-run.yml b/.ado/jobs/npm-publish-dry-run.yml index 7c86654ae5a5bd..dd77abda159c0b 100644 --- a/.ado/jobs/npm-publish-dry-run.yml +++ b/.ado/jobs/npm-publish-dry-run.yml @@ -11,4 +11,5 @@ jobs: fetchFilter: blob:none # partial clone for faster clones while maintaining history persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch - - template: /.ado/templates/npm-publish.yml@self + - template: /.ado/templates/npm-publish-steps.yml@self + diff --git a/.ado/publish.yml b/.ado/publish.yml index 25937ba414b39c..53f94091e590d6 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -71,67 +71,4 @@ extends: fetchFilter: blob:none # partial clone for faster clones while maintaining history persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch - - template: /.ado/templates/npm-publish.yml@self - - # 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: | - npx beachball publish --scope '!packages/react-native' --branch origin/$(Build.SourceBranchName) -n $(npmAuthToken) -yes -m "applying package updates ***NO_CI***" --access public + - template: /.ado/templates/npm-publish-steps.yml@self diff --git a/.ado/scripts/prepublish-check.mjs b/.ado/scripts/prepublish-check.mjs index baaff5ae5a97aa..83f563dc2a4b16 100644 --- a/.ado/scripts/prepublish-check.mjs +++ b/.ado/scripts/prepublish-check.mjs @@ -3,7 +3,7 @@ import { spawnSync } from "node:child_process"; import * as fs from "node:fs"; import * as util from "node:util"; -const ADO_PUBLISH_PIPELINE = ".ado/templates/npm-publish.yml"; +const ADO_PUBLISH_PIPELINE = ".ado/templates/npm-publish-steps.yml"; const NX_CONFIG_FILE = "nx.json"; const NPM_TAG_NEXT = "next"; diff --git a/.ado/templates/apple-tools-setup.yml b/.ado/templates/apple-tools-setup.yml index 9b82f6e1858025..f001e1b99bdcd8 100644 --- a/.ado/templates/apple-tools-setup.yml +++ b/.ado/templates/apple-tools-setup.yml @@ -7,4 +7,11 @@ steps: brew bundle --file .ado/Brewfile displayName: 'Install Homebrew dependencies' - - template: /.ado/templates/apple-xcode-select.yml@self + - script: | + sudo xcode-select --switch $(xcode_version) + displayName: Use $(xcode_friendly_name) + + - script: | + xcodebuild -downloadAllPlatforms + sudo xcodebuild -runFirstLaunch + displayName: 'Download Xcode Platforms' diff --git a/.ado/templates/apple-xcode-select.yml b/.ado/templates/apple-xcode-select.yml deleted file mode 100644 index 5cbc4e4301b047..00000000000000 --- a/.ado/templates/apple-xcode-select.yml +++ /dev/null @@ -1,5 +0,0 @@ -steps: - - bash: | - sudo xcode-select --switch $(xcode_version) - displayName: Use $(xcode_friendly_name) - failOnStderr: true diff --git a/.ado/templates/npm-publish.yml b/.ado/templates/npm-publish-steps.yml similarity index 54% rename from .ado/templates/npm-publish.yml rename to .ado/templates/npm-publish-steps.yml index cf2975603c6290..4a1e40956902b7 100644 --- a/.ado/templates/npm-publish.yml +++ b/.ado/templates/npm-publish-steps.yml @@ -3,6 +3,8 @@ parameters: publishTag: 'next' steps: + - template: /.ado/templates/configure-git.yml@self + - script: | yarn install displayName: Install npm dependencies @@ -12,17 +14,17 @@ steps: displayName: Verify release config - script: | - yarn nx release --dry-run + echo Target branch: $(System.PullRequest.TargetBranch) + yarn nx release --dry-run --verbose displayName: Version and publish packages (dry run) - condition: ${{ ne(variables['publish_react_native_macos'], '1') }} + condition: and(succeeded(), ne(variables['publish_react_native_macos'], '1')) - script: | - # TODO: Before we can change the line below to `yarn nx release --yes` on - # `main`, we must first set up the pipeline for nightly builds. Stable - # branches should be fine. - yarn nx release --dry-run + git switch $(Build.SourceBranchName) + yarn nx release --skip-publish --verbose + yarn nx release publish --excludeTaskDependencies env: GITHUB_TOKEN: $(githubAuthToken) NODE_AUTH_TOKEN: $(npmAuthToken) displayName: Version and publish packages - condition: ${{ eq(variables['publish_react_native_macos'], '1') }} + condition: and(succeeded(), eq(variables['publish_react_native_macos'], '1'))