Skip to content

Updated WASM build. #509

Updated WASM build.

Updated WASM build. #509

Workflow file for this run

name: macOS
on:
push:
branches: [ main ]
tags: 'v*.*.*'
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
name: Build & Test
runs-on: macos-latest
if: "startsWith(github.ref, 'refs/tags/') || !contains(github.event.head_commit.message, '[skip CI]')"
steps:
- uses: actions/checkout@v2
- name: build-test
run: |
brew install luarocks
sudo luarocks install busted
sudo luarocks make
make test
- name: luarocks upload
if: startsWith(github.ref, 'refs/tags/')
run: |
./yue -e spec/inputs/luarocks_upload.yue ${{ secrets.LUAROCKS_KEY }}
- name: build for luajit
if: startsWith(github.ref, 'refs/tags/')
run: |
git clone https://github.com/LuaJIT/LuaJIT.git
cd LuaJIT
TARGET_FLAGS="-arch x86_64" MACOSX_DEPLOYMENT_TARGET=11 make
mkdir x86_64
mv src/libluajit.a x86_64/liblua.a
MACOSX_DEPLOYMENT_TARGET=11 make clean
TARGET_FLAGS="-arch arm64" MACOSX_DEPLOYMENT_TARGET=11 make
mkdir arm64
mv src/libluajit.a arm64/liblua.a
cd ..
make shared LUAI=LuaJIT/src LUAL=LuaJIT/x86_64 TARGET_FLAGS="-arch x86_64"
mv bin/shared/yue.so yue_x86_64.so
make clean
make shared LUAI=LuaJIT/src LUAL=LuaJIT/arm64 TARGET_FLAGS="-arch arm64"
lipo -create yue_x86_64.so bin/shared/yue.so -output yue.so
zip -r yue-macos-universal-luajit-so.zip yue.so
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./yue-macos-universal-luajit-so.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}