diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d0dcdb4..41cdba8 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: @@ -45,8 +45,12 @@ jobs: if: matrix.os == 'macos' run: | env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X main.sha1ver=$(git rev-parse --short HEAD) -X 'main.buildTime=$(date)'" -tags ${{ matrix.lua-version }} -o getnovel-amd64 . - env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X main.sha1ver=$(git rev-parse --short HEAD) -X 'main.buildTime=$(date)'" -tags ${{ matrix.lua-version }} -o getnovel-arm64 . - lipo -create -output getnovel getnovel-amd64 getnovel-arm64 + if [ "${{ matrix.lua-version }}" == "luajit" ]; then + mv getnovel-amd64 getnovel + else + env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X main.sha1ver=$(git rev-parse --short HEAD) -X 'main.buildTime=$(date)'" -tags ${{ matrix.lua-version }} -o getnovel-arm64 . + lipo -create -output getnovel getnovel-amd64 getnovel-arm64 + fi curl -sSL -o kindlegen.zip https://github.com/ystyle/kaf-cli/releases/download/kindlegen/KindleGen_Mac_64bit_v2_9.zip unzip kindlegen.zip mkdir ${{ matrix.os }}-amd64 diff --git a/golua/lua/buildlua.sh b/golua/lua/buildlua.sh index 77a1203..6bb47c4 100755 --- a/golua/lua/buildlua.sh +++ b/golua/lua/buildlua.sh @@ -42,11 +42,16 @@ cd luajit if [ "$OS" == "Darwin" ]; then env MACOSX_DEPLOYMENT_TARGET=12.0 make clean env MACOSX_DEPLOYMENT_TARGET=12.0 CFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" make -j $CoreCount BUILDMODE=static - mv src/libluajit.a ./libluajit-amd64.a - env MACOSX_DEPLOYMENT_TARGET=12.0 make clean - env MACOSX_DEPLOYMENT_TARGET=12.0 CFLAGS="-arch arm64" LDFLAGS="-arch arm64" make -j $CoreCount BUILDMODE=static - mv src/libluajit.a ./libluajit-arm64.a - lipo -create -output libluajit.a libluajit-arm64.a libluajit-amd64.a + arch=`uname -m` + if [ "$arch" == "arm64" ]; then + mv src/libluajit.a ./libluajit-amd64.a + env MACOSX_DEPLOYMENT_TARGET=12.0 make clean + env MACOSX_DEPLOYMENT_TARGET=12.0 CFLAGS="-arch arm64" LDFLAGS="-arch arm64" make -j $CoreCount BUILDMODE=static + mv src/libluajit.a ./libluajit-arm64.a + lipo -create -output libluajit.a libluajit-arm64.a libluajit-amd64.a + else + mv src/libluajit.a ./libluajit.a + fi else make -j $CoreCount BUILDMODE=static mv src/*.a ./libluajit.a