diff options
Diffstat (limited to '')
| -rw-r--r-- | .github/workflows/macos.yml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 5181be0..e7e961a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml | |||
| @@ -3,6 +3,7 @@ name: macOS | |||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | branches: [ main ] | 5 | branches: [ main ] |
| 6 | tags: 'v*.*.*' | ||
| 6 | pull_request: | 7 | pull_request: |
| 7 | branches: [ main ] | 8 | branches: [ main ] |
| 8 | workflow_dispatch: | 9 | workflow_dispatch: |
| @@ -15,3 +16,29 @@ jobs: | |||
| 15 | - uses: actions/checkout@v2 | 16 | - uses: actions/checkout@v2 |
| 16 | - name: build-test | 17 | - name: build-test |
| 17 | run: make test | 18 | run: make test |
| 19 | - name: build for luajit | ||
| 20 | if: startsWith(github.ref, 'refs/tags/') | ||
| 21 | run: | | ||
| 22 | git clone https://github.com/LuaJIT/LuaJIT.git | ||
| 23 | cd LuaJIT | ||
| 24 | TARGET_FLAGS="-arch x86_64" MACOSX_DEPLOYMENT_TARGET=11 make | ||
| 25 | mkdir x86_64 | ||
| 26 | mv src/libluajit.a x86_64/liblua.a | ||
| 27 | MACOSX_DEPLOYMENT_TARGET=11 make clean | ||
| 28 | TARGET_FLAGS="-arch arm64" MACOSX_DEPLOYMENT_TARGET=11 make | ||
| 29 | mkdir arm64 | ||
| 30 | mv src/libluajit.a arm64/liblua.a | ||
| 31 | make shared LUAI=LuaJIT/src LUAL=LuaJIT/x86_64 TARGET_FLAGS="-arch x86_64" | ||
| 32 | mv bin/shared/yue.so yue_x86_64.so | ||
| 33 | make clean | ||
| 34 | make shared LUAI=LuaJIT/src LUAL=LuaJIT/arm64 TARGET_FLAGS="-arch arm64" | ||
| 35 | lipo -create yue_x86_64.so bin/shared/yue.so -output yue.so | ||
| 36 | zip -r yue-macos-universal-luajit-so.zip yue.so | ||
| 37 | - name: release | ||
| 38 | uses: softprops/action-gh-release@v1 | ||
| 39 | if: startsWith(github.ref, 'refs/tags/') | ||
| 40 | with: | ||
| 41 | files: | | ||
| 42 | ./yue-macos-universal-luajit-so.zip | ||
| 43 | env: | ||
| 44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
