-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
172 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: build | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
|
||
name: Building library | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout lua-vosk | ||
uses: actions/checkout@v3 | ||
with: | ||
path: luavosk | ||
|
||
- name: Minor preparations | ||
run: sudo apt install gcc-aarch64-linux-gnu mingw-w64 | ||
|
||
- name: Get previous tag | ||
id: prevtag | ||
shell: bash | ||
run: | | ||
echo "tag=$(GIT.EXE describe --abbrev=0 --tags ${{ github.ref_name }}^)" >> $GITHUB_OUTPUT | ||
- name: Init LuaJIT | ||
working-directory: luavosk/misc | ||
run: ./init.sh | ||
|
||
- name: Linux x64 build | ||
working-directory: luavosk/misc | ||
run: ./build-linux-x64.sh | ||
|
||
- name: Linux arm64 build | ||
working-directory: luavosk/misc | ||
run: ./build-linux-arm64.sh | ||
|
||
- name: Windows x64 build | ||
working-directory: luavosk/misc | ||
run: ./build-win-x64.sh | ||
|
||
- name: Zip it up | ||
working-directory: luavosk/misc/out | ||
run: | | ||
zip -q windows-x64.zip win-amd64/luavosk.dll | ||
zip -q linux-arm64.zip linux-arm64/luavosk.so | ||
zip -q linux-x64.zip linux-amd64/luavosk.so | ||
cd ../../ | ||
zip -q -u -r ./misc/out/windows-x64.zip test/ README.md LICENSE | ||
zip -q -u -r ./misc/out/linux-arm64.zip test/ README.md LICENSE | ||
zip -q -u -r ./misc/out/linux-x64.zip test/ README.md LICENSE | ||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
prerelease: true | ||
name: Pre-release ${{ github.ref_name }} | ||
body: "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.prevtag.outputs.tag }}...${{ github.ref_name }}" | ||
files: | | ||
./luavosk/misc/out/windows-x64.zip | ||
./luavosk/misc/out/linux-arm64.zip | ||
./luavosk/misc/out/linux-x64.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ test/* | |
test/webexample/*.dll | ||
.vscode/settings.json | ||
/build/ | ||
misc/out/ | ||
misc/luajit/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR aarch64) | ||
|
||
set(TOOLCHAIN_PREFIX aarch64-linux-gnu-) | ||
execute_process( | ||
COMMAND which ${TOOLCHAIN_PREFIX}gcc | ||
OUTPUT_VARIABLE BINUTILS_PATH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) | ||
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX}gcc) | ||
SET(CMAKE_C_COMPILER_FORCED TRUE CACHE INTERNAL "") | ||
|
||
set(CMAKE_MAKE_PROGRAM /usr/bin/make) | ||
|
||
set(CMAKE_FIND_ROOT_PATH ${BINUTILS_PATH}) | ||
set(CMAKE_INCLUDE_PATH /usr/${TOOLCHAIN_PREFIX}/include) | ||
set(CMAKE_LIBRARY_PATH /usr/${TOOLCHAIN_PREFIX}/lib) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(CMAKE_SYSTEM_PROCESSOR amd64) | ||
|
||
set(TOOLCHAIN_PREFIX x86_64-linux-gnu-) | ||
execute_process( | ||
COMMAND which ${TOOLCHAIN_PREFIX}gcc | ||
OUTPUT_VARIABLE BINUTILS_PATH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) | ||
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX}gcc) | ||
SET(CMAKE_C_COMPILER_FORCED TRUE CACHE INTERNAL "") | ||
|
||
set(CMAKE_MAKE_PROGRAM /usr/bin/make) | ||
|
||
set(CMAKE_FIND_ROOT_PATH ${BINUTILS_PATH}) | ||
set(CMAKE_INCLUDE_PATH /usr/${TOOLCHAIN_PREFIX}/include) | ||
set(CMAKE_LIBRARY_PATH /usr/${TOOLCHAIN_PREFIX}/lib) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
set(CMAKE_SYSTEM_PROCESSOR amd64) | ||
|
||
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32-) | ||
execute_process( | ||
COMMAND which ${TOOLCHAIN_PREFIX}gcc | ||
OUTPUT_VARIABLE BINUTILS_PATH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) | ||
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_PREFIX}gcc) | ||
SET(CMAKE_C_COMPILER_FORCED TRUE CACHE INTERNAL "") | ||
|
||
set(CMAKE_MAKE_PROGRAM /usr/bin/make) | ||
|
||
set(CMAKE_FIND_ROOT_PATH ${BINUTILS_PATH}) | ||
set(CMAKE_INCLUDE_PATH /usr/include/${TOOLCHAIN_PREFIX}) | ||
set(CMAKE_LIBRARY_PATH /usr/lib/${TOOLCHAIN_PREFIX}) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
MAINDIR=$(dirname `readlink -f "$0"`) | ||
cd "$MAINDIR/luajit" | ||
make clean | ||
make HOST_CC=gcc CROSS=aarch64-linux-gnu- TARGET_SYS=Linux -j$(nproc) | ||
cd "$MAINDIR" | ||
mkdir -p out/linux-arm64 | ||
cd out/linux-arm64 | ||
cmake "$MAINDIR/.." -DCMAKE_TOOLCHAIN_FILE="$MAINDIR/TC-linux-arm64.cmake" -DLUA_INCLUDE_DIR="$MAINDIR/luajit/src/" -DLUA_LIBRARIES="$MAINDIR/luajit/src/libluajit.so" | ||
make -j$(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
MAINDIR=$(dirname `readlink -f "$0"`) | ||
cd "$MAINDIR/luajit" | ||
make clean | ||
make HOST_CC=gcc CROSS=x86_64-linux-gnu- TARGET_SYS=Linux -j$(nproc) | ||
cd "$MAINDIR" | ||
mkdir -p out/linux-amd64 | ||
cd out/linux-amd64 | ||
cmake "$MAINDIR/.." -DCMAKE_TOOLCHAIN_FILE="$MAINDIR/TC-linux-x64.cmake" -DLUA_INCLUDE_DIR="$MAINDIR/luajit/src/" -DLUA_LIBRARIES="$MAINDIR/luajit/src/libluajit.so" | ||
make -j$(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
MAINDIR=$(dirname `readlink -f "$0"`) | ||
cd "$MAINDIR/luajit" | ||
make clean | ||
make HOST_CC=gcc CROSS=x86_64-w64-mingw32- TARGET_SYS=Windows -j$(nproc) | ||
cd "$MAINDIR" | ||
mkdir -p out/win-amd64 | ||
cd out/win-amd64 | ||
cmake "$MAINDIR/.." -DCMAKE_TOOLCHAIN_FILE="$MAINDIR/TC-win-x64.cmake" -DLUA_INCLUDE_DIR="$MAINDIR/luajit/src/" -DLUA_LIBRARIES="$MAINDIR/luajit/src/lua51.dll" | ||
make -j$(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
MAINDIR=$(dirname `readlink -f "$0"`) | ||
rm -rf "$MAINDIR/out/" | ||
git clone https://github.com/LuaJIT/LuaJIT "$MAINDIR/luajit" |