@@ -14,17 +14,17 @@ jobs:
14
14
run : |-
15
15
sudo apt update && sudo apt install -y libicu-dev
16
16
17
- with :
18
- path : hermes
17
+ - name : Copy source to $HERMES_WS_DIR/source
18
+ run : |-
19
+ mkdir -p $HERMES_WS_DIR
20
+ cp -r $GITHUB_WORKSPACE $HERMES_WS_DIR/source
19
21
- name : Build Hermes Compiler
20
22
run : |-
21
- cmake -S hermes -B $HERMES_WS_DIR/build
22
- # Build the Hermes compiler so that the cross compiler build can
23
- # access it to build the VM
23
+ cmake -S $HERMES_WS_DIR/source -B $HERMES_WS_DIR/build
24
24
cmake --build $HERMES_WS_DIR/build --target hermesc -j 4
25
25
- name : Build Hermes for Android
26
26
run : |-
27
- cd hermes /android
27
+ cd $HERMES_WS_DIR/source /android
28
28
./gradlew githubRelease
29
29
- name : Copy artifacts
30
30
run : |-
@@ -33,31 +33,35 @@ jobs:
33
33
- name : Checksum artifacts
34
34
run : |-
35
35
cd output
36
- for file in *
37
- do
36
+ for file in *; do
38
37
sha256sum "$file" > "$file.sha256"
39
38
done
40
39
41
40
with :
42
41
name : android-hermes
43
42
path : output
43
+
44
44
linux :
45
45
runs-on : ubuntu-22.04
46
+ env :
47
+ HERMES_WS_DIR : " /tmp/hermes"
46
48
steps :
47
49
- name : Install dependencies
48
50
run : |-
49
51
sudo apt update
50
52
sudo apt install -y git openssh-client cmake build-essential \
51
53
libreadline-dev libicu-dev zip python3
52
54
53
- with :
54
- path : hermes
55
+ - name : Copy source to $HERMES_WS_DIR/source
56
+ run : |-
57
+ mkdir -p $HERMES_WS_DIR
58
+ cp -r $GITHUB_WORKSPACE $HERMES_WS_DIR/source
55
59
- name : Build linux CLI
56
60
run : |-
57
- cmake -S hermes -B build_hdb -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release \
61
+ cmake -S $HERMES_WS_DIR/source -B build_hdb -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release \
58
62
-DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
59
63
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
60
- cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release \
64
+ cmake -S $HERMES_WS_DIR/source -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release \
61
65
-DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
62
66
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive" \
63
67
-DHERMES_ENABLE_DEBUGGER=False
@@ -76,40 +80,51 @@ jobs:
76
80
with :
77
81
name : linux-hermes
78
82
path : output
83
+
79
84
macos :
80
- runs-on : macos-14
85
+ runs-on : macos-15
86
+ env :
87
+ TERM : dumb
88
+ HERMES_WS_DIR : " /tmp/hermes"
89
+ HOMEBREW_NO_AUTO_UPDATE : 1
81
90
steps :
82
91
- uses : maxim-lobanov/setup-xcode@v1
83
92
with :
84
93
xcode-version : 16.2
85
94
86
- with :
87
- path : hermes
95
+ - name : Copy source to $HERMES_WS_DIR/source
96
+ run : |-
97
+ mkdir -p $HERMES_WS_DIR
98
+ cp -r $GITHUB_WORKSPACE $HERMES_WS_DIR/source
99
+ - name : Set up workspace
100
+ run : mkdir -p $HERMES_WS_DIR/output
88
101
- name : Install dependencies
89
- run : brew install cmake ninja
102
+ run : |-
103
+ brew install ninja
104
+ ninja --version
105
+ cmake --version
90
106
- name : Build macOS CLI
91
107
run : |-
92
- cmake -S hermes -B build -G Ninja ${RELEASE_FLAGS} -DHERMES_ENABLE_DEBUGGER=False
93
- cmake --build ./build --target hermes hvm hbcdump hermesc
94
- cmake -S hermes -B build_hdb -G Ninja ${RELEASE_FLAGS}
95
- cmake --build ./build_hdb --target hdb
108
+ cmake -S $HERMES_WS_DIR/source -B $HERMES_WS_DIR/build_macos -G Ninja ${RELEASE_FLAGS} -DHERMES_ENABLE_DEBUGGER=False
109
+ cmake --build $HERMES_WS_DIR/build_macos --target hermes hvm hbcdump hermesc
110
+ working-directory : ${{ env.HERMES_WS_DIR }}/source
96
111
env :
97
112
RELEASE_FLAGS : " -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_OSX_ARCHITECTURES=x86_64;arm64 \\ -DBUILD_SHARED_LIBS=OFF -DHERMES_BUILD_SHARED_JSI=OFF"
98
113
- name : Create CLI tarball
99
114
run : |-
100
- mkdir output staging
101
- cp build/bin/hermes build/bin/hvm build/bin/hbcdump \
102
- build/bin/hermesc build_hdb/bin/hdb staging
103
- tar -C staging -czvf output/${TAR_NAME} .
104
- shasum -a 256 output/${TAR_NAME} > output/${TAR_NAME}.sha256
105
- env :
106
- TAR_NAME : hermes-cli-darwin.tar.gz
115
+ mkdir staging
116
+ cp $HERMES_WS_DIR/build_macos/bin/{hermes,hvm,hbcdump,hermesc} staging
117
+ TARBALL=$HERMES_WS_DIR/output/hermes-cli-darwin.tar.gz
118
+ tar -C staging -czvf $TARBALL .
119
+ shasum -a 256 $TARBALL > $TARBALL.sha256
120
+ working-directory : ${{ env.HERMES_WS_DIR }}/source
107
121
108
122
with :
109
123
name : macos-hermes
110
- path : output
124
+ path : ${{ env.HERMES_WS_DIR }}/output
125
+
111
126
build-apple-runtime :
112
- runs-on : macos-14
127
+ runs-on : macos-15
113
128
env :
114
129
TERM : dumb
115
130
HERMES_WS_DIR : " /tmp/hermes"
@@ -119,81 +134,54 @@ jobs:
119
134
with :
120
135
xcode-version : 16.2
121
136
122
- - name : Cache setup
123
- uses : actions/cache@v4
124
- with :
125
- key : v4-repo-${{ github.sha }}
126
- path : |-
127
- build_iphoneos
128
- build_catalyst
129
- build_iphonesimulator
130
- destroot
137
+ - name : Copy source to $HERMES_WS_DIR/source
138
+ run : |-
139
+ mkdir -p $HERMES_WS_DIR
140
+ cp -r $GITHUB_WORKSPACE $HERMES_WS_DIR/source
131
141
- name : Set up workspace
132
- run : mkdir -p /tmp/hermes /output
142
+ run : mkdir -p $HERMES_WS_DIR /output
133
143
- name : Install dependencies
134
144
run : |-
135
- brew install cmake ninja
145
+ brew install ninja
136
146
sudo gem install cocoapods
147
+ ninja --version
148
+ cmake --version
137
149
- name : Build the iOS frameworks
138
150
run : " ./utils/build-ios-framework.sh"
151
+ working-directory : ${{ env.HERMES_WS_DIR }}/source
139
152
- name : Build the Mac frameworks
140
153
run : " ./utils/build-mac-framework.sh"
141
- package-apple-runtime :
142
- runs-on : macos-14
143
- needs :
144
- - build-apple-runtime
145
- env :
146
- TERM : dumb
147
- HERMES_WS_DIR : " /tmp/hermes"
148
- HOMEBREW_NO_AUTO_UPDATE : 1
149
- steps :
150
- - uses : maxim-lobanov/setup-xcode@v1
151
- with :
152
- xcode-version : 16.2
153
-
154
- - name : Cache setup
155
- uses : actions/cache@v4
156
- with :
157
- key : v4-repo-${{ github.sha }}
158
- path : |-
159
- build_iphoneos
160
- build_catalyst
161
- build_iphonesimulator
162
- destroot
163
- - name : Set up workspace
164
- run : mkdir -p /tmp/hermes/output
165
- - name : Install dependencies
166
- run : |-
167
- brew install cmake ninja
168
- sudo gem install cocoapods
154
+ working-directory : ${{ env.HERMES_WS_DIR }}/source
169
155
- name : Package the framework
170
156
run : |-
171
157
. ./utils/build-apple-framework.sh
172
158
mkdir -p /tmp/cocoapods-package-root/destroot
173
159
cp -R ./destroot /tmp/cocoapods-package-root
174
160
cp hermes-engine.podspec LICENSE /tmp/cocoapods-package-root
175
- tar -C /tmp/cocoapods-package-root/ -czvf /tmp/hermes/output/hermes-runtime-darwin-v$(get_release_version).tar.gz .
161
+ tar -C /tmp/cocoapods-package-root/ -czvf $HERMES_WS_DIR/output/hermes-runtime-darwin-v$(get_release_version).tar.gz .
162
+ working-directory : ${{ env.HERMES_WS_DIR }}/source
176
163
- name : Checksum artifacts
177
164
run : |-
178
- cd /tmp/hermes/output
179
- for file in *
180
- do
165
+ for file in *; do
181
166
shasum -a 256 "$file" > "$file.sha256"
182
167
done
168
+ working-directory : ${{ env.HERMES_WS_DIR }}/output
183
169
184
170
with :
185
171
name : apple-runtime
186
- path : /tmp/hermes/output/
172
+ path : ${{ env.HERMES_WS_DIR }}/output/
173
+
187
174
npm :
188
175
runs-on : ubuntu-22.04
189
176
needs :
190
- - android
191
- - linux
192
- - package -apple-runtime
193
- - macos
177
+ - android
178
+ - linux
179
+ - build -apple-runtime
180
+ - macos
194
181
env :
195
182
YARN : yarnpkg
196
183
TERM : dumb
184
+ HERMES_WS_DIR : " /tmp/hermes"
197
185
DEBIAN_FRONTEND : noninteractive
198
186
steps :
199
187
@@ -202,12 +190,11 @@ jobs:
202
190
node --version
203
191
yarn --version
204
192
- name : Install dependencies and set up
205
- run : mkdir -p /tmp/hermes /output
193
+ run : mkdir -p $HERMES_WS_DIR /output
206
194
207
195
208
196
- name : Build NPM
209
197
run : |-
210
- ls -lR
211
198
cd npm
212
199
cp ../macos-hermes/* .
213
200
cp ../android-hermes/* .
@@ -219,15 +206,14 @@ jobs:
219
206
- name : Copy artifacts
220
207
run : |-
221
208
cd npm
222
- cp *.tgz /tmp/hermes /output
209
+ cp *.tgz $HERMES_WS_DIR /output
223
210
- name : Checksum artifacts
224
211
run : |-
225
- cd /tmp/hermes/output
226
- for file in *
227
- do
212
+ cd $HERMES_WS_DIR/output
213
+ for file in *; do
228
214
sha256sum "$file" > "$file.sha256"
229
215
done
230
216
231
217
with :
232
218
name : npm-hermes
233
- path : /tmp/hermes /output
219
+ path : ${{ env.HERMES_WS_DIR }} /output
0 commit comments