Skip to content

Commit 3c17c57

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Remove dual Hermes version outputs from CI workflows (#56739)
Summary: Pull Request resolved: #56739 ## Summary - Simplify `publish-release.yml`: remove `HERMES_V1_VERSION` output, read only `HERMES_VERSION_NAME` - Simplify `create-draft-release.yml`: remove `hermesV1Version` input - Simplify `createDraftRelease.js`: remove `hermesV1Version` parameter and "Hermes V1 dSYMS" section from release notes - Simplify `prebuild-ios-core.yml`: read `HERMES_VERSION_NAME` instead of `HERMES_V1_VERSION_NAME` - Delete unused `prepare-hermes-v1-app` action, `hermes-v1.patch`, and `selectLatestHermesV1Version.js` ## Changelog: [Internal] ## Test plan - [x] JS tests: `yarn jest --no-watchman createDraftRelease-test.js` — 9/9 tests pass Reviewed By: cortinico Differential Revision: D104381269
1 parent c77e84a commit 3c17c57

8 files changed

Lines changed: 43 additions & 164 deletions

File tree

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

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

.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/prebuild-ios-core.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
- name: Set Hermes version
4848
shell: bash
4949
run: |
50+
# Nightly RN builds resolve Hermes from npm's latest-v1 dist-tag (TODO:
51+
# rename to 'latest' once V1 is the only Hermes on npm). Stable builds
52+
# use the version pinned in version.properties.
5053
if [ "${{ inputs.use-hermes-nightly }}" == "true" ]; then
5154
HERMES_VERSION="latest-v1"
5255
else

.github/workflows/publish-release.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,19 @@ jobs:
1919
echo "Setting release type to release"
2020
echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT
2121
22-
set_hermes_versions:
22+
set_hermes_version:
2323
runs-on: ubuntu-latest
2424
if: github.repository == 'facebook/react-native'
2525
outputs:
26-
HERMES_VERSION: ${{ steps.set_hermes_versions.outputs.HERMES_VERSION }}
27-
HERMES_V1_VERSION: ${{ steps.set_hermes_versions.outputs.HERMES_V1_VERSION }}
26+
HERMES_VERSION: ${{ steps.set_hermes_version.outputs.HERMES_VERSION }}
2827
steps:
2928
- name: Checkout
3029
uses: actions/checkout@v6
31-
- id: set_hermes_versions
30+
- id: set_hermes_version
3231
run: |
33-
echo "Setting hermes versions to latest"
3432
hermes_version=$(grep -oE 'HERMES_VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)' packages/react-native/sdks/hermes-engine/version.properties | cut -d'=' -f2)
35-
3633
echo "HERMES_VERSION=$hermes_version" >> $GITHUB_OUTPUT
37-
echo "HERMES_V1_VERSION=$hermes_version" >> $GITHUB_OUTPUT
38-
- name: Print hermes versions
39-
run: |
40-
echo "HERMES_VERSION=${{ steps.set_hermes_versions.outputs.HERMES_VERSION }}"
41-
echo "HERMES_V1_VERSION=${{ steps.set_hermes_versions.outputs.HERMES_V1_VERSION }}"
34+
echo "HERMES_VERSION=$hermes_version"
4235
4336
prebuild_apple_dependencies:
4437
if: github.repository == 'facebook/react-native'
@@ -142,9 +135,8 @@ jobs:
142135
secrets: inherit
143136

144137
create_draft_release:
145-
needs: [generate_changelog, set_hermes_versions]
138+
needs: [generate_changelog, set_hermes_version]
146139
uses: ./.github/workflows/create-draft-release.yml
147140
secrets: inherit
148141
with:
149-
hermesVersion: ${{ needs.set_hermes_versions.outputs.HERMES_VERSION }}
150-
hermesV1Version: ${{ needs.set_hermes_versions.outputs.HERMES_V1_VERSION }}
142+
hermesVersion: ${{ needs.set_hermes_version.outputs.HERMES_VERSION }}

0 commit comments

Comments
 (0)