Skip to content

Commit a731784

Browse files
committed
Merge branch 'main' into set-log-box-max-font-size
2 parents 78fe7f3 + 8823a80 commit a731784

180 files changed

Lines changed: 3139 additions & 4424 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/prepare-hermes-v1-app/action.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/actions/test-ios-helloworld/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ runs:
2323
uses: ruby/setup-ruby@v1
2424
with:
2525
ruby-version: ${{ inputs.ruby-version }}
26-
- name: Set nightly Hermes versions
26+
- name: Set Hermes prebuilt version
2727
shell: bash
2828
run: |
29-
node ./scripts/releases/use-hermes-nightly.js
29+
node ./scripts/releases/use-hermes-prebuilt.js
3030
- name: Run yarn install again, with the correct hermes version
3131
uses: ./.github/actions/yarn-install
3232
- name: Download ReactNativeDependencies

.github/actions/test-ios-rntester/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ runs:
3232
uses: ruby/setup-ruby@v1
3333
with:
3434
ruby-version: ${{ inputs.ruby-version }}
35-
- name: Set nightly Hermes versions
35+
- name: Set Hermes prebuilt version
3636
shell: bash
3737
run: |
38-
node ./scripts/releases/use-hermes-nightly.js
38+
node ./scripts/releases/use-hermes-prebuilt.js
3939
- name: Run yarn install again, with the correct hermes version
4040
uses: ./.github/actions/yarn-install
4141
- name: Prepare IOS Tests

.github/workflow-scripts/__tests__/createDraftRelease-test.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ describe('Create Draft Release', () => {
121121
});
122122

123123
describe('#_computeBody', () => {
124-
it('computes body for release when no hermes versions are passed', async () => {
124+
it('falls back to HERMES_VERSION_NAME from version.properties when no hermes version is passed', async () => {
125125
const version = '0.77.1';
126+
const hermesVersion = '250829098.0.13';
127+
jest.spyOn(fs, 'readFileSync').mockImplementationOnce(() => {
128+
return `HERMES_VERSION_NAME=${hermesVersion}\n`;
129+
});
126130
const changelog = `## v${version}
127131
### Breaking Changes
128132
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
@@ -140,13 +144,9 @@ describe('Create Draft Release', () => {
140144
141145
---
142146
143-
Hermes dSYMS:
144-
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-debug.tar.gz)
145-
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-release.tar.gz)
146-
147147
Hermes V1 dSYMS:
148-
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-debug.tar.gz)
149-
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-release.tar.gz)
148+
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
149+
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)
150150
151151
ReactNativeDependencies dSYMs:
152152
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
@@ -172,7 +172,6 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
172172
it('computes body for release when hermes versions are passed', async () => {
173173
const version = '0.77.1';
174174
const hermesVersion = '0.15.0';
175-
const hermesV1Version = '250829098.0.2';
176175
const changelog = `## v${version}
177176
### Breaking Changes
178177
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
@@ -184,25 +183,16 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
184183
#### iOS
185184
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
186185
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change`;
187-
const body = _computeBody(
188-
changelog,
189-
version,
190-
hermesVersion,
191-
hermesV1Version,
192-
);
186+
const body = _computeBody(changelog, version, hermesVersion);
193187

194188
expect(body).toEqual(`${changelog}
195189
196190
---
197191
198-
Hermes dSYMS:
192+
Hermes V1 dSYMS:
199193
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
200194
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)
201195
202-
Hermes V1 dSYMS:
203-
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-debug.tar.gz)
204-
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-release.tar.gz)
205-
206196
ReactNativeDependencies dSYMs:
207197
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
208198
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)

.github/workflow-scripts/createDraftRelease.js

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,33 @@ function _extractChangelog(version) {
4040
return changelog.slice(changelogStarts, changelogEnds).join('\n').trim();
4141
}
4242

43-
function _computeBody(changelog, version, hermesVersion, hermesV1Version) {
44-
hermesVersion = hermesVersion ?? version;
45-
hermesV1Version = hermesV1Version ?? version;
43+
function _readHermesVersionFromProperties() {
44+
const propertiesPath =
45+
'packages/react-native/sdks/hermes-engine/version.properties';
46+
const content = String(fs.readFileSync(propertiesPath, 'utf8'));
47+
const match = content.match(/^HERMES_VERSION_NAME=(.+)$/m);
48+
if (!match) {
49+
throw new Error(`HERMES_VERSION_NAME not found in ${propertiesPath}`);
50+
}
51+
return match[1].trim();
52+
}
53+
54+
function _computeBody(changelog, version, hermesVersion) {
55+
// The workflow input is optional and arrives as an empty string when unset,
56+
// so treat both missing and empty as "fall back to version.properties".
57+
// Falling back to ${version} would produce 404 dSYMS URLs since Hermes V1
58+
// versions (e.g. 250829098.0.13) don't track RN versions.
59+
if (hermesVersion == null || hermesVersion === '') {
60+
hermesVersion = _readHermesVersionFromProperties();
61+
}
4662
return `${changelog}
4763
4864
---
4965
50-
Hermes dSYMS:
66+
Hermes V1 dSYMS:
5167
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
5268
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)
5369
54-
Hermes V1 dSYMS:
55-
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-debug.tar.gz)
56-
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-release.tar.gz)
57-
5870
ReactNativeDependencies dSYMs:
5971
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
6072
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
@@ -123,21 +135,15 @@ function moveToChangelogBranch(version) {
123135
run(`git checkout -b changelog/v${version}`);
124136
}
125137

126-
async function createDraftRelease(
127-
version,
128-
latest,
129-
token,
130-
hermesVersion,
131-
hermesV1Version,
132-
) {
138+
async function createDraftRelease(version, latest, token, hermesVersion) {
133139
if (version.startsWith('v')) {
134140
version = version.substring(1);
135141
}
136142

137143
_verifyTagExists(version);
138144
moveToChangelogBranch(version);
139145
const changelog = _extractChangelog(version);
140-
const body = _computeBody(changelog, version, hermesVersion, hermesV1Version);
146+
const body = _computeBody(changelog, version, hermesVersion);
141147
const release = await _createDraftReleaseOnGitHub(
142148
version,
143149
body,
@@ -155,4 +161,5 @@ module.exports = {
155161
_extractChangelog,
156162
_computeBody,
157163
_createDraftReleaseOnGitHub,
164+
_readHermesVersionFromProperties,
158165
};

.github/workflow-scripts/hermes-v1.patch

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflow-scripts/selectLatestHermesV1Version.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/create-draft-release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ on:
66
hermesVersion:
77
required: false
88
type: string
9-
description: The version of Hermes to use for this release (eg. 0.15.0). If not specified, it will use React Native Version
10-
hermesV1Version:
11-
required: false
12-
type: string
13-
description: The version of Hermes V1 to use for this release (eg. 250829098.0.2). If not specified, it will use React Native Version
9+
description: The version of Hermes to use for this release (eg. 250829098.0.2). If not specified, it will read HERMES_VERSION_NAME from version.properties
1410

1511
jobs:
1612
create-draft-release:
@@ -37,7 +33,7 @@ jobs:
3733
const {createDraftRelease} = require('./.github/workflow-scripts/createDraftRelease.js');
3834
const version = '${{ github.ref_name }}';
3935
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
40-
return (await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}', '${{ inputs.hermesVersion }}', '${{ inputs.hermesV1Version }}')).id;
36+
return (await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}', '${{ inputs.hermesVersion }}')).id;
4137
result-encoding: string
4238
- name: Upload release assets for DotSlash
4339
uses: actions/github-script@v8

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
prebuild_react_native_core:
3030
uses: ./.github/workflows/prebuild-ios-core.yml
3131
with:
32-
use-hermes-nightly: true
32+
use-hermes-prebuilt: true
3333
version-type: nightly
3434
secrets: inherit
3535
needs: [prebuild_apple_dependencies]

.github/workflows/prebuild-ios-core.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
type: string
99
required: false
1010
default: ''
11-
use-hermes-nightly:
12-
description: 'Whether to use the hermes nightly build or read the version from the versions.properties file'
11+
use-hermes-prebuilt:
12+
description: 'Whether to resolve Hermes from the latest-v1 npm dist-tag (true) or from the version pinned in version.properties (false)'
1313
type: boolean
1414
required: false
1515
default: false
@@ -47,12 +47,13 @@ jobs:
4747
- name: Set Hermes version
4848
shell: bash
4949
run: |
50-
if [ "${{ inputs.use-hermes-nightly }}" == "true" ]; then
51-
# We are not publishing nightly versions of Hermes V1 yet.
52-
# For now, we can use the latest version of Hermes V1 published on maven and npm.
50+
# Non-stable RN builds resolve Hermes from npm's latest-v1 dist-tag.
51+
# TODO: rename 'latest-v1' to 'latest' once V1 is the only Hermes on npm.
52+
# Stable builds use the version pinned in version.properties.
53+
if [ "${{ inputs.use-hermes-prebuilt }}" == "true" ]; then
5354
HERMES_VERSION="latest-v1"
5455
else
55-
HERMES_VERSION=$(sed -n 's/^HERMES_V1_VERSION_NAME=//p' packages/react-native/sdks/hermes-engine/version.properties)
56+
HERMES_VERSION=$(sed -n 's/^HERMES_VERSION_NAME=//p' packages/react-native/sdks/hermes-engine/version.properties)
5657
fi
5758
echo "Using Hermes version: $HERMES_VERSION"
5859
echo "HERMES_VERSION=$HERMES_VERSION" >> $GITHUB_ENV

0 commit comments

Comments
 (0)