mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
a28867f952
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48237 Noticed this when trying to diagnose what seemed like a stale caching issue. It effectively reverts D59917944. D59917944 added logic to only do yarn caching on main, but it has some correctness issues: 1. We cache `node_modules` instead of the yarn cache, which may contain e.g. build artifacts, or other scratch/cache files written (such as anything that writes to `node_modules/.cache`). We really want to be caching the yarn cache, which has pristine packages before install, which I think it will also need to perform the real install anyways. 2. We key the cache on root `package.json`, which is missing a lot of information (both provided by the other `package.json` in the repo, but mostly, the lockfile resolution). We only save cache when we're on `refs/heads/main` (so continuous builds against main), and supposedly, builds against base branch should be able to restore against those, but recent PR jobs I have seen, where `package.json` has not changed, all have `Cache not found for input keys: node-modules-068350889e87919c1c6c2c220c8d2d92db13f38820bf2efb315d1274b97bc367` Because of the potential correctness issues, and that the strategy for limiting to main seemingly is not allowing cache to be used in PR, this diff goes back to previous solution, which may store more artifacts (but working cache should also reduce cost by making jobs run faster). Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D67140004 fbshipit-source-id: f74074a498af56b1837fa23cf80795f76935b762
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
name: create_release
|
|
description: Creates a new React Native release
|
|
inputs:
|
|
version:
|
|
description: "The version of React Native we want to release. For example 0.75.0-rc.0"
|
|
required: true
|
|
is-latest-on-npm:
|
|
description: "Whether we want to tag this release as latest on NPM"
|
|
required: true
|
|
default: "false"
|
|
dry-run:
|
|
description: "Whether the job should be executed in dry-run mode or not"
|
|
default: "true"
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Yarn install
|
|
uses: ./.github/actions/yarn-install
|
|
- name: Configure Git
|
|
shell: bash
|
|
run: |
|
|
git config --local user.email "bot@reactnative.dev"
|
|
git config --local user.name "React Native Bot"
|
|
- name: Creating release commit
|
|
shell: bash
|
|
run: |
|
|
node scripts/releases/create-release-commit.js \
|
|
--reactNativeVersion "${{ inputs.version }}" \
|
|
--tagAsLatestRelease "${{ inputs.is-latest-on-npm }}" \
|
|
--dryRun "${{ inputs.dry-run }}"
|
|
GIT_PAGER=cat git show HEAD
|
|
- name: Update "latest" tag if needed
|
|
shell: bash
|
|
if: ${{ inputs.is-latest-on-npm == 'true' }}
|
|
run: |
|
|
git tag -d "latest"
|
|
git push origin :latest
|
|
git tag -a "latest" -m "latest"
|
|
- name: Pushing release commit
|
|
shell: bash
|
|
if: ${{ inputs.dry-run == 'false' }}
|
|
run: |
|
|
CURR_BRANCH="$(git branch --show-current)"
|
|
git push origin "$CURR_BRANCH" --follow-tags
|