From 9aedbe8a16cec56f49a6c830abde14defbeb85d2 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Wed, 4 Dec 2024 17:00:52 -0800 Subject: [PATCH] ci(0.76): Enable publishing of stable releases --- .ado/publish.yml | 63 ---------------------------------- .ado/templates/npm-publish.yml | 7 ++-- 2 files changed, 2 insertions(+), 68 deletions(-) diff --git a/.ado/publish.yml b/.ado/publish.yml index 512c33833ada28..6772e90e810fd9 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -74,66 +74,3 @@ extends: 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 diff --git a/.ado/templates/npm-publish.yml b/.ado/templates/npm-publish.yml index cf2975603c6290..ac0172b91ae93c 100644 --- a/.ado/templates/npm-publish.yml +++ b/.ado/templates/npm-publish.yml @@ -1,6 +1,6 @@ parameters: # If this is a new stable branch, change `publishTag` to `latest` when going stable - publishTag: 'next' + publishTag: 'latest' steps: - script: | @@ -17,10 +17,7 @@ steps: condition: ${{ 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 + yarn nx release --yes env: GITHUB_TOKEN: $(githubAuthToken) NODE_AUTH_TOKEN: $(npmAuthToken)