Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: bring publish pipeline updates from 0.76-stable to main #2314

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
65 changes: 1 addition & 64 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .ado/scripts/prepublish-check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 4 additions & 0 deletions .ado/templates/apple-tools-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ steps:
brew bundle --file .ado/Brewfile
displayName: 'Install Homebrew dependencies'

- script: |
sudo xcode-select --switch $(xcode_version)
displayName: Use $(xcode_friendly_name)

- template: /.ado/templates/apple-xcode-select.yml@self
5 changes: 0 additions & 5 deletions .ado/templates/apple-xcode-select.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ parameters:
publishTag: 'next'

steps:
- template: /.ado/templates/configure-git.yml@self

- script: |
yarn install
displayName: Install npm dependencies
Expand All @@ -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'))
2 changes: 1 addition & 1 deletion packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
},
"dependencies": {
"@jest/create-cache-key-function": "^29.6.3",
"@react-native-mac/virtualized-lists": "workspace:*",
"@react-native-mac/virtualized-lists": "0.76.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be reverted?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the change from workspace:* to 0.76.4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the notes in this PR: #2318
As Tommy pointed out, I should revert for the main branch.

"@react-native/assets-registry": "0.76.0-main",
"@react-native/codegen": "0.76.0-main",
"@react-native/community-cli-plugin": "0.76.0-main",
Expand Down
21 changes: 19 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,24 @@ __metadata:
languageName: unknown
linkType: soft

"@react-native-mac/virtualized-lists@workspace:*, @react-native-mac/virtualized-lists@workspace:packages/virtualized-lists":
"@react-native-mac/virtualized-lists@npm:0.76.4":
version: 0.76.4
resolution: "@react-native-mac/virtualized-lists@npm:0.76.4"
dependencies:
invariant: "npm:^2.2.4"
nullthrows: "npm:^1.1.1"
peerDependencies:
"@types/react": ^18.2.6
react: "*"
react-native: "*"
peerDependenciesMeta:
"@types/react":
optional: true
checksum: 10c0/896165fc21755502ed6d659510e2f69a69d0c2bd564ccb838dfec6c2d1d84dcd9e4d4ce2f1adddbe91dc4ea627a61dc747efe3f4335a071d88ee8a9cb035d062
languageName: node
linkType: hard

"@react-native-mac/virtualized-lists@workspace:packages/virtualized-lists":
version: 0.0.0-use.local
resolution: "@react-native-mac/virtualized-lists@workspace:packages/virtualized-lists"
dependencies:
Expand Down Expand Up @@ -10576,7 +10593,7 @@ __metadata:
resolution: "react-native-macos@workspace:packages/react-native"
dependencies:
"@jest/create-cache-key-function": "npm:^29.6.3"
"@react-native-mac/virtualized-lists": "workspace:*"
"@react-native-mac/virtualized-lists": "npm:0.76.4"
"@react-native/assets-registry": "npm:0.76.0-main"
"@react-native/codegen": "npm:0.76.0-main"
"@react-native/community-cli-plugin": "npm:0.76.0-main"
Expand Down
Loading