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

Merged
merged 11 commits into from
Jan 15, 2025
Next Next commit
ci: Enable publishing of stable releases
Saadnajmi committed Jan 15, 2025
commit 86b97233d15f475ebe5f2f629f4196b9871d8a4a
63 changes: 0 additions & 63 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
@@ -72,66 +72,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
5 changes: 1 addition & 4 deletions .ado/templates/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -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)