Skip to content

Commit 3b4b91a

Browse files
Saadnajmiclaude
andcommitted
fix: add CLI subcommands and simplify get_architecture
Address review feedback: - Add build_hermesc and prepare_dest_root CLI subcommands so CI can execute the script directly instead of sourcing it - Simplify get_architecture from 5 branches to 2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 68dde91 commit 3b4b91a

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

.github/workflows/build-hermes-macos.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ jobs:
5555
shell: bash
5656
run: |
5757
chmod +x ./utils/build-apple-framework.sh
58-
source ./utils/build-apple-framework.sh
59-
prepare_dest_root_for_ci
58+
./utils/build-apple-framework.sh prepare_dest_root
6059
- name: Create universal xcframework
6160
shell: bash
6261
run: |

.github/workflows/build-hermesc-apple.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
- name: Build HermesC Apple
1414
shell: bash
1515
run: |
16-
source ./utils/build-apple-framework.sh
17-
build_host_hermesc_if_needed
16+
chmod +x ./utils/build-apple-framework.sh
17+
./utils/build-apple-framework.sh build_hermesc
1818
- name: Upload HermesC Artifact
1919
uses: actions/upload-artifact@v4.3.4
2020
with:

utils/build-apple-framework.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,9 @@ function get_release_version {
7575
# Given a specific target, retrieve the right architecture for it
7676
# $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, macosx, xros, xrsimulator, appletvos, appletvsimulator
7777
function get_architecture {
78-
if [[ $1 == "iphoneos" || $1 == "xros" ]]; then
78+
if [[ $1 == "iphoneos" || $1 == "xros" || $1 == "appletvos" ]]; then
7979
echo "arm64"
80-
elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" ]]; then
81-
echo "x86_64;arm64"
82-
elif [[ $1 == "appletvos" ]]; then
83-
echo "arm64"
84-
elif [[ $1 == "appletvsimulator" ]]; then
85-
echo "x86_64;arm64"
86-
elif [[ $1 == "catalyst" || $1 == "macosx" ]]; then
80+
elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" || $1 == "appletvsimulator" || $1 == "catalyst" || $1 == "macosx" ]]; then
8781
echo "x86_64;arm64"
8882
else
8983
echo "Error: unknown architecture passed $1"
@@ -318,6 +312,10 @@ if [[ -z $1 ]]; then
318312
create_framework
319313
elif [[ $1 == "build_framework" ]]; then
320314
build_universal_framework
315+
elif [[ $1 == "build_hermesc" ]]; then
316+
build_host_hermesc_if_needed
317+
elif [[ $1 == "prepare_dest_root" ]]; then
318+
prepare_dest_root_for_ci
321319
else
322320
build_framework "$1"
323321
fi

0 commit comments

Comments
 (0)