Skip to content

Commit

Permalink
build with luajit
Browse files Browse the repository at this point in the history
  • Loading branch information
missdeer committed Jan 18, 2024
1 parent dd51e78 commit d3b3015
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
Build:
strategy:
matrix:
lua-version: [lua51, lua52, lua53, lua54]
lua-version: [lua51, lua52, lua53, lua54, luajit]
os: [macos, ubuntu, windows]
runs-on: ${{ matrix.os }}-latest
steps:
Expand All @@ -31,8 +31,8 @@ jobs:
./buildlua.sh
cd -
- name: Build on Unix
if: matrix.os != 'macos' && matrix.os != 'windows'
- name: Build GetNovel on Linux
if: matrix.os == 'ubuntu'
run: |
go build -ldflags="-s -w" -tags ${{ matrix.lua-version }} -o getnovel .
mkdir ${{ matrix.os }}-amd64
Expand All @@ -41,7 +41,7 @@ jobs:
cp -r handlers ${{ matrix.os }}-amd64/
cp -r lua ${{ matrix.os }}-amd64/
- name: Build on macOS
- name: Build GetNovel on macOS
if: matrix.os == 'macos'
run: |
env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -tags ${{ matrix.lua-version }} -o getnovel-amd64 .
Expand All @@ -60,8 +60,17 @@ jobs:
if: matrix.os == 'windows'
shell: msys2 {0}
run: |
cd golua/lua/${{ matrix.lua-version }}
env MSYSTEM=MINGW64 PATH=$PATH:/mingw64/bin make mingw
if [ "${{ matrix.lua-version }}" == "luajit" ]; then
cd golua/lua
git clone --depth 1 https://github.com/LuaJIT/LuaJIT.git luajit
cd luajit
env MSYSTEM=MINGW64 PATH=$PATH:/mingw64/bin make
mv src/*.a ./
mv src/*.dll ../../../
else
cd golua/lua/${{ matrix.lua-version }}
env MSYSTEM=MINGW64 PATH=$PATH:/mingw64/bin make mingw
fi
cd -
- name: Build GetNovel on Windows
Expand All @@ -78,8 +87,8 @@ jobs:
curl -sSL -o kindlegen.zip https://github.com/ystyle/kaf-cli/releases/download/kindlegen/kindlegen_win32_v2_9.zip
unzip kindlegen.zip
mkdir ${{ matrix.os }}-amd64
cp getnovel.exe ${{ matrix.os }}-amd64/
cp kindlegen.exe ${{ matrix.os }}-amd64/
cp *.exe ${{ matrix.os }}-amd64/
cp *.dll ${{ matrix.os }}-amd64/
cp -r pdfpresets ${{ matrix.os }}-amd64/
cp -r handlers ${{ matrix.os }}-amd64/
cp -r lua ${{ matrix.os }}-amd64/
Expand Down

0 comments on commit d3b3015

Please sign in to comment.