Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/actions/prepare-hermes-v1-app/action.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/actions/test-ios-helloworld/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ runs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Set nightly Hermes versions
- name: Set Hermes prebuilt version
shell: bash
run: |
node ./scripts/releases/use-hermes-nightly.js
node ./scripts/releases/use-hermes-prebuilt.js
- name: Run yarn install again, with the correct hermes version
uses: ./.github/actions/yarn-install
- name: Download ReactNativeDependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/test-ios-rntester/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ runs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ inputs.ruby-version }}
- name: Set nightly Hermes versions
- name: Set Hermes prebuilt version
shell: bash
run: |
node ./scripts/releases/use-hermes-nightly.js
node ./scripts/releases/use-hermes-prebuilt.js
- name: Run yarn install again, with the correct hermes version
uses: ./.github/actions/yarn-install
- name: Prepare IOS Tests
Expand Down
28 changes: 9 additions & 19 deletions .github/workflow-scripts/__tests__/createDraftRelease-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ describe('Create Draft Release', () => {
});

describe('#_computeBody', () => {
it('computes body for release when no hermes versions are passed', async () => {
it('falls back to HERMES_VERSION_NAME from version.properties when no hermes version is passed', async () => {
const version = '0.77.1';
const hermesVersion = '250829098.0.13';
jest.spyOn(fs, 'readFileSync').mockImplementationOnce(() => {
return `HERMES_VERSION_NAME=${hermesVersion}\n`;
});
const changelog = `## v${version}
### Breaking Changes
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
Expand All @@ -140,13 +144,9 @@ describe('Create Draft Release', () => {

---

Hermes dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-release.tar.gz)

Hermes V1 dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-release.tar.gz)
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)

ReactNativeDependencies dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
Expand All @@ -172,7 +172,6 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
it('computes body for release when hermes versions are passed', async () => {
const version = '0.77.1';
const hermesVersion = '0.15.0';
const hermesV1Version = '250829098.0.2';
const changelog = `## v${version}
### Breaking Changes
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
Expand All @@ -184,25 +183,16 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
#### iOS
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change`;
const body = _computeBody(
changelog,
version,
hermesVersion,
hermesV1Version,
);
const body = _computeBody(changelog, version, hermesVersion);

expect(body).toEqual(`${changelog}

---

Hermes dSYMS:
Hermes V1 dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)

Hermes V1 dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-release.tar.gz)

ReactNativeDependencies dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
Expand Down
39 changes: 23 additions & 16 deletions .github/workflow-scripts/createDraftRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,33 @@ function _extractChangelog(version) {
return changelog.slice(changelogStarts, changelogEnds).join('\n').trim();
}

function _computeBody(changelog, version, hermesVersion, hermesV1Version) {
hermesVersion = hermesVersion ?? version;
hermesV1Version = hermesV1Version ?? version;
function _readHermesVersionFromProperties() {
const propertiesPath =
'packages/react-native/sdks/hermes-engine/version.properties';
const content = String(fs.readFileSync(propertiesPath, 'utf8'));
const match = content.match(/^HERMES_VERSION_NAME=(.+)$/m);
if (!match) {
throw new Error(`HERMES_VERSION_NAME not found in ${propertiesPath}`);
}
return match[1].trim();
}

function _computeBody(changelog, version, hermesVersion) {
// The workflow input is optional and arrives as an empty string when unset,
// so treat both missing and empty as "fall back to version.properties".
// Falling back to ${version} would produce 404 dSYMS URLs since Hermes V1
// versions (e.g. 250829098.0.13) don't track RN versions.
if (hermesVersion == null || hermesVersion === '') {
hermesVersion = _readHermesVersionFromProperties();
}
return `${changelog}

---

Hermes dSYMS:
Hermes V1 dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)

Hermes V1 dSYMS:
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-release.tar.gz)

ReactNativeDependencies dSYMs:
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
Expand Down Expand Up @@ -123,21 +135,15 @@ function moveToChangelogBranch(version) {
run(`git checkout -b changelog/v${version}`);
}

async function createDraftRelease(
version,
latest,
token,
hermesVersion,
hermesV1Version,
) {
async function createDraftRelease(version, latest, token, hermesVersion) {
if (version.startsWith('v')) {
version = version.substring(1);
}

_verifyTagExists(version);
moveToChangelogBranch(version);
const changelog = _extractChangelog(version);
const body = _computeBody(changelog, version, hermesVersion, hermesV1Version);
const body = _computeBody(changelog, version, hermesVersion);
const release = await _createDraftReleaseOnGitHub(
version,
body,
Expand All @@ -155,4 +161,5 @@ module.exports = {
_extractChangelog,
_computeBody,
_createDraftReleaseOnGitHub,
_readHermesVersionFromProperties,
};
30 changes: 0 additions & 30 deletions .github/workflow-scripts/hermes-v1.patch

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflow-scripts/selectLatestHermesV1Version.js

This file was deleted.

8 changes: 2 additions & 6 deletions .github/workflows/create-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ on:
hermesVersion:
required: false
type: string
description: The version of Hermes to use for this release (eg. 0.15.0). If not specified, it will use React Native Version
hermesV1Version:
required: false
type: string
description: The version of Hermes V1 to use for this release (eg. 250829098.0.2). If not specified, it will use React Native Version
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

jobs:
create-draft-release:
Expand All @@ -37,7 +33,7 @@ jobs:
const {createDraftRelease} = require('./.github/workflow-scripts/createDraftRelease.js');
const version = '${{ github.ref_name }}';
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
return (await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}', '${{ inputs.hermesVersion }}', '${{ inputs.hermesV1Version }}')).id;
return (await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}', '${{ inputs.hermesVersion }}')).id;
result-encoding: string
- name: Upload release assets for DotSlash
uses: actions/github-script@v8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
prebuild_react_native_core:
uses: ./.github/workflows/prebuild-ios-core.yml
with:
use-hermes-nightly: true
use-hermes-prebuilt: true
version-type: nightly
secrets: inherit
needs: [prebuild_apple_dependencies]
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/prebuild-ios-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
type: string
required: false
default: ''
use-hermes-nightly:
description: 'Whether to use the hermes nightly build or read the version from the versions.properties file'
use-hermes-prebuilt:
description: 'Whether to resolve Hermes from the latest-v1 npm dist-tag (true) or from the version pinned in version.properties (false)'
type: boolean
required: false
default: false
Expand Down Expand Up @@ -47,12 +47,13 @@ jobs:
- name: Set Hermes version
shell: bash
run: |
if [ "${{ inputs.use-hermes-nightly }}" == "true" ]; then
# We are not publishing nightly versions of Hermes V1 yet.
# For now, we can use the latest version of Hermes V1 published on maven and npm.
# Non-stable RN builds resolve Hermes from npm's latest-v1 dist-tag.
# TODO: rename 'latest-v1' to 'latest' once V1 is the only Hermes on npm.
# Stable builds use the version pinned in version.properties.
if [ "${{ inputs.use-hermes-prebuilt }}" == "true" ]; then
HERMES_VERSION="latest-v1"
else
HERMES_VERSION=$(sed -n 's/^HERMES_V1_VERSION_NAME=//p' packages/react-native/sdks/hermes-engine/version.properties)
HERMES_VERSION=$(sed -n 's/^HERMES_VERSION_NAME=//p' packages/react-native/sdks/hermes-engine/version.properties)
fi
echo "Using Hermes version: $HERMES_VERSION"
echo "HERMES_VERSION=$HERMES_VERSION" >> $GITHUB_ENV
Expand Down
21 changes: 6 additions & 15 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,19 @@ jobs:
echo "Setting release type to release"
echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT

set_hermes_versions:
set_hermes_version:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
outputs:
HERMES_VERSION: ${{ steps.set_hermes_versions.outputs.HERMES_VERSION }}
HERMES_V1_VERSION: ${{ steps.set_hermes_versions.outputs.HERMES_V1_VERSION }}
HERMES_VERSION: ${{ steps.set_hermes_version.outputs.HERMES_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v6
- id: set_hermes_versions
- id: set_hermes_version
run: |
echo "Setting hermes versions to latest"
hermes_version=$(grep -oE 'HERMES_VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)' packages/react-native/sdks/hermes-engine/version.properties | cut -d'=' -f2)
hermes_v1_version=$(grep -oE 'HERMES_V1_VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)' packages/react-native/sdks/hermes-engine/version.properties | cut -d'=' -f2)

echo "HERMES_VERSION=$hermes_version" >> $GITHUB_OUTPUT
echo "HERMES_V1_VERSION=$hermes_v1_version" >> $GITHUB_OUTPUT
- name: Print hermes versions
run: |
echo "HERMES_VERSION=${{ steps.set_hermes_versions.outputs.HERMES_VERSION }}"
echo "HERMES_V1_VERSION=${{ steps.set_hermes_versions.outputs.HERMES_V1_VERSION }}"
echo "HERMES_VERSION=$hermes_version"

prebuild_apple_dependencies:
if: github.repository == 'facebook/react-native'
Expand Down Expand Up @@ -143,9 +135,8 @@ jobs:
secrets: inherit

create_draft_release:
needs: [generate_changelog, set_hermes_versions]
needs: [generate_changelog, set_hermes_version]
uses: ./.github/workflows/create-draft-release.yml
secrets: inherit
with:
hermesVersion: ${{ needs.set_hermes_versions.outputs.HERMES_VERSION }}
hermesV1Version: ${{ needs.set_hermes_versions.outputs.HERMES_V1_VERSION }}
hermesVersion: ${{ needs.set_hermes_version.outputs.HERMES_VERSION }}
Loading
Loading