Skip to content

Commit 5ae9e8d

Browse files
committed
Add support for building universal lua-https modules.
1 parent 55fa64f commit 5ae9e8d

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.github/workflows/build.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,35 @@ jobs:
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v3
13-
- name: Install Lua 5.1
14-
uses: leafo/gh-actions[email protected]
13+
- name: Download LuaJIT
14+
uses: actions/checkout@v3
1515
with:
16-
luaVersion: "5.1.5"
16+
repository: LuaJIT/LuaJIT
17+
ref: v2.1
18+
path: LuaJIT
19+
- name: Compile universal LuaJIT
20+
working-directory: ./LuaJIT
21+
run: |
22+
TARGET_FLAGS="-arch x86_64" make
23+
cp ./src/libluajit.so ./src/libluajit_x64.dylib
24+
cp ./src/luajit ./src/luajit_x64
25+
26+
make clean
27+
28+
TARGET_FLAGS="-arch arm64" make
29+
cp ./src/libluajit.so ./src/libluajit_arm.dylib
30+
cp ./src/luajit ./src/luajit_arm
31+
32+
lipo -create -output ./src/libluajit.dylib ./src/libluajit_x64.dylib ./src/libluajit_arm.dylib
33+
lipo -create -output ./src/luajit ./src/luajit_x64 ./src/luajit_arm
1734
- name: Configure
18-
run: cmake -Bbuild -S. -G Xcode -DLUA_INCLUDE_DIR=$PWD/.lua/include -DLUA_LIBRARIES=$PWD/.lua/lib/liblua.a
35+
run: cmake -Bbuild -S. -G Xcode -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DLUA_INCLUDE_DIR=$PWD/LuaJIT/src -DLUA_LIBRARIES=$PWD/LuaJIT/src/lua
1936
- name: Build
2037
working-directory: build
2138
run: xcodebuild -configuration Release -scheme https
2239
- name: Test
2340
working-directory: ./build/src/Release
24-
run: lua -l "https" ../../../example/test.lua
41+
run: ../../../LuaJIT/src/luajit -l "https" ../../../example/test.lua
2542
- name: Artifact
2643
if: always()
2744
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)