From d3b301547fc10f7e8e09a5c8fa1d9a1919af2039 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Thu, 18 Jan 2024 16:30:19 +0800 Subject: [PATCH] build with luajit --- .github/workflows/go.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e6d698d..1f4fb20 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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: @@ -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 @@ -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 . @@ -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 @@ -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/