Skip to content

Build

Build #74

Workflow file for this run

name: Build
on:
workflow_dispatch: # manually trigger
workflow_call:
permissions:
contents: write
jobs:
#########################################################Common Libs Build####################################################
#Windows
build_windows_x86_64_lib_MSVC:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Windows
run: |
cd build\lib\win64
.\build_all_and_pack.bat native msvc YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows_x86_64_libs
path: ${{ github.workspace }}/dist
build_windows_x86_64_lib_Clang:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Windows
run: |
cd build\lib\win64
.\build_all_and_pack.bat native clang YES NO
build_windows_x86_64_lib_MinGW:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java (JDK 11)
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Install MSYS2 (CLANG64)
id: msys2
uses: msys2/setup-msys2@v2
with:
msystem: CLANG64
update: true
release: true
path-type: inherit
install: >-
mingw-w64-clang-x86_64-toolchain
mingw-w64-clang-x86_64-ninja
- name: Remove conflicting MinGW paths
shell: powershell
run: |
$env:Path = $env:Path -replace 'C:\\mingw64\\bin;','' -replace 'C:\\Program Files\\Git\\mingw64\\bin;',''
echo "PATH=$env:Path" >> $env:GITHUB_ENV
- name: Add MSYS2 CLANG64 to PATH
shell: powershell
run: |
$bin = "${{ steps.msys2.outputs.msys2-location }}\clang64\bin"
echo $bin
echo $bin >> $env:GITHUB_PATH
- name: Toolchain check
shell: powershell
run: |
clang --version
ninja --version
where clang
where ninja
cmake --version
- name: Build (x64)
shell: cmd
run: |
cd build\lib\win64
call build_all_and_pack.bat native mingw YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows_mingw_x86_64_libs
path: ${{ github.workspace }}/dist
build_windows_x86_64_tools:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build Tools
run: |
cd build\tools\win64
.\build_all_and_pack.bat
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows_x86_64_tools
path: ${{ github.workspace }}/dist
build_windows_arm64_lib_MSVC:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Windows
run: |
cd build\lib\win64
.\build_all_and_pack.bat arm64 msvc YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows_arm64_libs
path: ${{ github.workspace }}/dist
build_windows_arm64_lib_Clang:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Windows
run: |
cd build\lib\win64
.\build_all_and_pack.bat arm64 clang YES NO
build_windows_arm64_lib_MinGW:
runs-on: windows-11-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java (JDK 21)
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: Install MSYS2 (CLANGARM64)
id: msys2
uses: msys2/setup-msys2@v2
with:
msystem: CLANGARM64
update: true
release: true
path-type: inherit
install: >-
mingw-w64-clang-aarch64-toolchain
mingw-w64-clang-aarch64-ninja
- name: Remove conflicting MinGW paths
shell: powershell
run: |
$env:Path = $env:Path -replace 'C:\\mingw64\\bin;','' -replace 'C:\\Program Files\\Git\\mingw64\\bin;',''
echo "PATH=$env:Path" >> $env:GITHUB_ENV
- name: Add MSYS2 CLANG ARM64 to PATH
shell: powershell
run: |
$bin = "${{ steps.msys2.outputs.msys2-location }}\clangarm64\bin"
echo $bin
echo $bin >> $env:GITHUB_PATH
- name: Toolchain check
shell: powershell
run: |
clang --version
ninja --version
where clang
where ninja
cmake --version
- name: Build (ARM64)
shell: cmd
run: |
cd build\lib\win64
call build_all_and_pack.bat native mingw YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows_mingw_arm64_libs
path: ${{ github.workspace }}/dist
build_windows_arm64_tools:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build Tools
run: |
cd build\tools\win64
.\build_all_and_pack.bat arm64
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: windows_arm64_tools
path: ${{ github.workspace }}/dist
#Android
build_windows_android:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Set up Android SDK (with NDK)
id: setup-android
uses: android-actions/setup-android@v3
- name: Set up NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r28c
local-cache: false
- name: Build for Windows Android
run: |
cd build\lib\android
.\win_build_all_and_pack.bat
env:
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
build_mac_android:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Set up Android SDK (with NDK)
id: setup-android
uses: android-actions/setup-android@v3
- name: Set up NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r28c
local-cache: false
- name: Build for Mac Android
run: |
cd build/lib/android
chmod +x *.sh
./mac_build_all_and_pack.sh
env:
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
build_linux_android:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Set up Android SDK (with NDK)
id: setup-android
uses: android-actions/setup-android@v3
- name: Set up NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r28c
local-cache: false
- name: Build for Linux Android
run: |
cd build/lib/android
chmod +x ./*.sh
./linux_build_all_and_pack.sh
env:
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: android_libs
path: ${{ github.workspace }}/dist
#Linux-ubuntu-x86_64
build_ubuntu_x86_64_lib_Clang:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Linux
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native clang YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: linux_x86_64_libs
path: ${{ github.workspace }}/dist
build_ubuntu_x86_64_lib_GCC:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Linux
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native gcc YES NO
build_ubuntu_x86_64_tools_Clang:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Linux
run: |
cd build/tools/linux
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
./build_all_and_pack_clang.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: linux_x86_64_tools
path: ${{ github.workspace }}/dist
build_ubuntu_x86_64_tools_GCC:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Linux
run: |
cd build/tools/linux
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
./build_all_and_pack_gcc.sh
#Linux-ubuntu-arm64
build_ubuntu_arm64_lib_Clang:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Linux
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native clang YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: linux_arm64_libs
path: ${{ github.workspace }}/dist
build_ubuntu_arm64_lib_GCC:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Linux
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native gcc YES NO
build_ubuntu_arm64_tools_Clang:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Linux
run: |
cd build/tools/linux
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
./build_all_and_pack_clang.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: linux_arm64_tools
path: ${{ github.workspace }}/dist
build_ubuntu_arm64_tools_GCC:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Linux
run: |
cd build/tools/linux
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
./build_all_and_pack_gcc.sh
#Linux-debian-x86
build_debian_x86_lib_Clang:
runs-on: ubuntu-latest
container:
image: ghcr.io/pippocao/bqlog/i386_debian:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable UTF-8 locale
run: |
apt-get update
apt-get install -y locales
sed -i 's/# *en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i 's/# *zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=en_US.UTF-8
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US:en" >> $GITHUB_ENV
locale
- name: Install necessary tools (gcc and clang)
run: |
apt-get update
apt-get install -y gcc clang g++ make cmake gdb
apt-get install -y software-properties-common
apt-get update
apt-get install -y openjdk-17-jdk
apt-get install -y openssh-client
- name: Set up Java
run: |
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386" >> $GITHUB_ENV
- name: Build for Debian 32
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native clang YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: linux_x86_libs
path: ${{ github.workspace }}/dist
build_debian_x86_lib_GCC:
runs-on: ubuntu-latest
container:
image: ghcr.io/pippocao/bqlog/i386_debian:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable UTF-8 locale
run: |
apt-get update
apt-get install -y locales
sed -i 's/# *en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i 's/# *zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=en_US.UTF-8
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US:en" >> $GITHUB_ENV
locale
- name: Install necessary tools (gcc and clang)
run: |
apt-get update
apt-get install -y gcc clang g++ make cmake gdb
apt-get install -y software-properties-common
apt-get update
apt-get install -y openjdk-17-jdk
apt-get install -y openssh-client
- name: Set up Java
run: |
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386" >> $GITHUB_ENV
- name: Build for Debian 32
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native gcc YES NO
build_debian_x86_tools_Clang:
runs-on: ubuntu-latest
container:
image: ghcr.io/pippocao/bqlog/i386_debian:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable UTF-8 locale
run: |
apt-get update
apt-get install -y locales
sed -i 's/# *en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i 's/# *zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=en_US.UTF-8
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US:en" >> $GITHUB_ENV
locale
- name: Install necessary tools (gcc and clang)
run: |
apt-get update
apt-get install -y gcc clang g++ make cmake gdb
apt-get install -y software-properties-common
apt-get update
apt-get install -y openjdk-17-jdk
apt-get install -y openssh-client
- name: Set up Java
run: |
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386" >> $GITHUB_ENV
- name: Build for Debian 32
run: |
cd build/tools/linux
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
./build_all_and_pack_clang.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: linux_x86_tools
path: ${{ github.workspace }}/dist
build_debian_x86_tools_GCC:
runs-on: ubuntu-latest
container:
image: ghcr.io/pippocao/bqlog/i386_debian:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable UTF-8 locale
run: |
apt-get update
apt-get install -y locales
sed -i 's/# *en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i 's/# *zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=en_US.UTF-8
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US:en" >> $GITHUB_ENV
locale
- name: Install necessary tools (gcc and clang)
run: |
apt-get update
apt-get install -y gcc clang g++ make cmake gdb
apt-get install -y software-properties-common
apt-get update
apt-get install -y openjdk-17-jdk
apt-get install -y openssh-client
- name: Set up Java
run: |
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386" >> $GITHUB_ENV
- name: Build for Debian 32
run: |
cd build/tools/linux
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
./build_all_and_pack_gcc.sh
#Mac
build_mac_lib:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build for Mac
run: |
cd build/lib/mac
chmod +x *.sh
./build_all_and_pack.sh YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: macos_universal_binary_libs
path: ${{ github.workspace }}/dist
build_mac_tools:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build for Mac
run: |
cd build/tools/mac
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
./build_all_and_pack.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: macos_universal_binary_tools
path: ${{ github.workspace }}/dist
#freebsd_x86_64
build_freebsd_x86_64_libs_Clang:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run in FreeBSD
id: RunInFreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
mem: 8192
prepare: |
pkg install -y llvm cmake bash openjdk11 gdb gcc
run: |
set -e -x
pkg info -l openjdk11 | grep 'bin/java'
export JAVA_HOME="/usr/local/openjdk11"
export PATH="$JAVA_HOME/bin:$PATH"
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
cd build/lib/unix_like
chmod +x *.sh
ls -l
export BQ_UNIX_VERSION=freebsd
./build_all_and_pack.sh native clang YES NO
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: freebsd_x86_64_libs
path: ${{ github.workspace }}/dist
build_freebsd_x86_64_libs_GCC:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run in FreeBSD
id: RunInFreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
mem: 8192
prepare: |
pkg install -y llvm cmake bash openjdk11 gdb gcc
run: |
set -e -x
pkg info -l openjdk11 | grep 'bin/java'
export JAVA_HOME="/usr/local/openjdk11"
export PATH="$JAVA_HOME/bin:$PATH"
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
cd build/lib/unix_like
chmod +x *.sh
ls -l
export BQ_UNIX_VERSION=freebsd
./build_all_and_pack.sh native gcc YES NO
build_freebsd_x86_64_tools_Clang:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run in FreeBSD
id: RunInFreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
mem: 8192
prepare: |
pkg install -y llvm cmake bash openjdk11 gdb gcc
run: |
set -e -x
pkg info -l openjdk11 | grep 'bin/java'
export JAVA_HOME="/usr/local/openjdk11"
export PATH="$JAVA_HOME/bin:$PATH"
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
cd build/tools/unix_like
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
ls -l
export BQ_UNIX_VERSION=freebsd
./build_all_and_pack_clang.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: freebsd_x86_64_tools
path: ${{ github.workspace }}/dist
build_freebsd_x86_64_tools_GCC:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run in FreeBSD
id: RunInFreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
mem: 8192
prepare: |
pkg install -y llvm cmake bash openjdk11 gdb gcc
run: |
set -e -x
pkg info -l openjdk11 | grep 'bin/java'
export JAVA_HOME="/usr/local/openjdk11"
export PATH="$JAVA_HOME/bin:$PATH"
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
cd build/tools/unix_like
chmod +x category_log_generator/*.sh
chmod +x log_decoder/*.sh
chmod +x *.sh
ls -l
export BQ_UNIX_VERSION=freebsd
./build_all_and_pack_gcc.sh
#iOS
build_ios_lib:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build for Mac
run: |
cd build/lib/ios
chmod +x *.sh
./build_all_and_pack.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ios_libs
path: ${{ github.workspace }}/dist
#HarmonyOS
build_harmony_os_on_mac:
runs-on: macos-latest
env:
REPO: pippocao/Images
TAG: OHOS_Mac_Arm64_CommandLineTool_6.0.0
ZIP_NAME: commandline-tools-mac-arm64-6.0.0.858.zip
TOOL_NAME: ohos-commandline-tools
TOOL_VERSION: 6.0.0.858
INSTALL_DIR: ${{ github.workspace }}/.toolcache/ohos/commandline-tools/6.0.0.858
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Restore extracted dir cache
id: cache-restore
uses: actions/cache/restore@v4
with:
path: ${{ env.INSTALL_DIR }}
key: macos-arm64-${{ env.TOOL_NAME }}-${{ env.TOOL_VERSION }}
- name: Download from Release when cache miss
if: steps.cache-restore.outputs.cache-hit != 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euxo pipefail
mkdir -p "${RUNNER_TEMP}"
gh release download "${TAG}" \
--repo "${REPO}" \
--pattern "${ZIP_NAME}" \
--dir "${RUNNER_TEMP}"
ls -lh "${RUNNER_TEMP}"
- name: Extract when cache miss
if: steps.cache-restore.outputs.cache-hit != 'true'
run: |
set -euxo pipefail
mkdir -p "${INSTALL_DIR}"
unzip -q "${RUNNER_TEMP}/${ZIP_NAME}" -d "${INSTALL_DIR}"
/usr/bin/find "${INSTALL_DIR}" -maxdepth 2 -mindepth 1 -print
- name: Build for Mac
run: |
export PATH="${INSTALL_DIR}/command-line-tools/bin:${PATH}"
export OHOS_SDK="${INSTALL_DIR}/command-line-tools/sdk/default/openharmony"
cd build/lib/ohos
chmod +x *.sh
./mac_build_all_and_pack.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: harmony_os_libs
path: ${{ github.workspace }}/dist
#Java wrapper
build_windows_java11_wrapper:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Build for Java
run: |
cd build\wrapper\java
.\build_all_and_pack.bat
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: java_wrapper
path: ${{ github.workspace }}/dist
#C# wrapper
build_windows_csharp_wrapper:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install and Pack
run: |
robocopy ".\wrapper\csharp" ".\install\wrapper\csharp" /E /R:0 /W:0
robocopy ".\docs" ".\install\docs" /E /R:0 /W:0
robocopy ".\" ".\install" *.md /R:0 /W:0
cd .\build\wrapper\csharp\
mkdir pack
cd pack
cmake ../../../../pack -G "Unix Makefiles" -DTARGET_PLATFORM:STRING=all -DPACKAGE_NAME:STRING=bqlog-c#-wrapper
cmake --build . --config Release --target package
cd ..
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: c#_wrapper
path: ${{ github.workspace }}/dist
#########################################################NodeJS Build####################################################
#Windows
nodejs_build_windows_x86_64_lib_MSVC:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
npx node-gyp install
- name: Build for Windows
run: |
cd build\lib\win64
.\build_all_and_pack.bat native msvc YES YES
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: node_windows_x86_64_libs
path: ${{ github.workspace }}/dist
nodejs_build_windows_x86_64_lib_Clang:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
npx node-gyp install
- name: Build for Windows
run: |
cd build\lib\win64
.\build_all_and_pack.bat native clang YES YES
nodejs_build_windows_arm64_lib_MSVC:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
npx node-gyp install --arch=arm64
- name: Build for Windows
run: |
cd build\lib\win64
.\build_all_and_pack.bat arm64 msvc YES YES
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: node_windows_arm64_libs
path: ${{ github.workspace }}/dist
nodejs_build_windows_arm64_lib_Clang:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
npx node-gyp install --arch=arm64
- name: Build for Windows
run: |
cd build\lib\win64
.\build_all_and_pack.bat arm64 clang YES YES
#Linux-ubuntu-x86_64
nodejs_build_ubuntu_x86_64_lib_Clang:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
- name: Build for Linux
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native clang YES YES
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: node_linux_x86_64_libs
path: ${{ github.workspace }}/dist
#Linux-ubuntu-x86_64
nodejs_build_ubuntu_x86_64_lib_GCC:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
- name: Build for Linux
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native gcc YES YES
#Linux-ubuntu-arm64
nodejs_build_ubuntu_arm64_lib_Clang:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
- name: Build for Linux
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native clang YES YES
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: node_linux_arm64_libs
path: ${{ github.workspace }}/dist
nodejs_build_ubuntu_arm64_lib_GCC:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
- name: Build for Linux
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native gcc YES YES
#Linux-debian-x86
nodejs_build_debian_x86_lib_Clang:
runs-on: ubuntu-latest
container:
image: ghcr.io/pippocao/bqlog/i386_debian:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable UTF-8 locale
run: |
apt-get update
apt-get install -y locales
sed -i 's/# *en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i 's/# *zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=en_US.UTF-8
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US:en" >> $GITHUB_ENV
locale
- name: Install necessary tools (gcc and clang)
run: |
apt-get update
apt-get install -y gcc clang g++ make cmake gdb
apt-get install -y software-properties-common
apt-get update
apt-get install -y openjdk-17-jdk
apt-get install -y openssh-client
- name: Set up Java
run: |
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386" >> $GITHUB_ENV
- name: Install Node.js and node-api-headers (Debian i386)
run: |
apt-get update
apt-get install -y nodejs npm
npm install node-api-headers
- name: Build for Debian 32
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native clang YES YES
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: node_linux_x86_libs
path: ${{ github.workspace }}/dist
nodejs_build_debian_x86_lib_GCC:
runs-on: ubuntu-latest
container:
image: ghcr.io/pippocao/bqlog/i386_debian:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable UTF-8 locale
run: |
apt-get update
apt-get install -y locales
sed -i 's/# *en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i 's/# *zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=en_US.UTF-8
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US:en" >> $GITHUB_ENV
locale
- name: Install necessary tools (gcc and clang)
run: |
apt-get update
apt-get install -y gcc clang g++ make cmake gdb
apt-get install -y software-properties-common
apt-get update
apt-get install -y openjdk-17-jdk
apt-get install -y openssh-client
- name: Set up Java
run: |
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-i386" >> $GITHUB_ENV
- name: Install Node.js and node-api-headers (Debian i386)
run: |
apt-get update
apt-get install -y nodejs npm
npm install node-api-headers
- name: Build for Debian 32
run: |
cd build/lib/linux
chmod +x *.sh
./build_all_and_pack.sh native gcc YES YES
#Mac
nodejs_build_mac_lib:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
check-latest: true
- name: Install node-api-headers
run: |
npm install node-api-headers
- name: Build for Mac
run: |
cd build/lib/mac
chmod +x *.sh
./build_all_and_pack.sh YES YES
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: node_macos_universal_binary_libs
path: ${{ github.workspace }}/dist
#freebsd_x86_64
nodejs_build_freebsd_x86_64_libs_Clang:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run in FreeBSD
id: RunInFreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
mem: 8192
prepare: |
pkg install -y llvm cmake bash openjdk11 gdb gcc node
pkg install -y npm-node22 || pkg install -y npm-node20 || pkg install -y npm
run: |
set -e -x
pkg info -l openjdk11 | grep 'bin/java'
export JAVA_HOME="/usr/local/openjdk11"
export PATH="$JAVA_HOME/bin:$PATH"
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
# Install node-api-headers at repo root before build
npm install node-api-headers
cd build/lib/unix_like
chmod +x *.sh
ls -l
export BQ_UNIX_VERSION=freebsd
./build_all_and_pack.sh native clang YES YES
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: node_freebsd_x86_64_libs
path: ${{ github.workspace }}/dist
#freebsd_x86_64
nodejs_build_freebsd_x86_64_libs_GCC:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run in FreeBSD
id: RunInFreeBSD
uses: vmactions/freebsd-vm@v1
with:
usesh: true
mem: 8192
prepare: |
pkg install -y llvm cmake bash openjdk11 gdb gcc node
pkg install -y npm-node22 || pkg install -y npm-node20 || pkg install -y npm
run: |
set -e -x
pkg info -l openjdk11 | grep 'bin/java'
export JAVA_HOME="/usr/local/openjdk11"
export PATH="$JAVA_HOME/bin:$PATH"
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
# Install node-api-headers at repo root before build
npm install node-api-headers
cd build/lib/unix_like
chmod +x *.sh
ls -l
export BQ_UNIX_VERSION=freebsd
./build_all_and_pack.sh native gcc YES YES
nodejs_collect_and_stage_prebuilds:
runs-on: ubuntu-latest
needs: [nodejs_build_windows_x86_64_lib_MSVC, nodejs_build_windows_arm64_lib_MSVC, nodejs_build_ubuntu_x86_64_lib_Clang, nodejs_build_ubuntu_arm64_lib_Clang, nodejs_build_debian_x86_lib_Clang, nodejs_build_mac_lib, nodejs_build_freebsd_x86_64_libs_Clang]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts from native builds
uses: actions/download-artifact@v4
with:
path: downloaded_artifacts
- name: Prepare tools
run: |
sudo apt-get update
sudo apt-get install -y unzip
- name: Extract all archives (zip and tar.gz) with artifact prefix and list contents
shell: bash
run: |
set -euo pipefail
mkdir -p extracted
shopt -s nullglob
get_artifact_name() {
# downloaded_artifacts/<artifact-name>/<file>
local p="$1"
basename "$(dirname "$p")"
}
# unzip *.zip(unzip to extracted/<artifact>/<base>)
for z in downloaded_artifacts/**/*.zip downloaded_artifacts/*.zip; do
artifact="$(get_artifact_name "$z")"
base="$(basename "${z%.*}")"
d="extracted/${artifact}/${base}"
mkdir -p "$d"
echo "::group::Unzip $z -> $d"
unzip -l "$z" || true
unzip -o "$z" -d "$d"
/usr/bin/find "$d" -maxdepth 2 -print | sort
echo "::endgroup::"
done
# tar -xzf *.tgz / *.tar.gz(unzip to extracted/<artifact>/<base>)
for t in downloaded_artifacts/**/*.tgz downloaded_artifacts/*.tgz downloaded_artifacts/**/*.tar.gz downloaded_artifacts/*.tar.gz; do
artifact="$(get_artifact_name "$t")"
fname="$(basename "$t")"
base="${fname%.tar.gz}"
base="${base%.tgz}"
d="extracted/${artifact}/${base}"
mkdir -p "$d"
echo "::group::Untar $t -> $d"
echo "Listing contents of $t"
tar -tzf "$t" | sed -n '1,200p' || true
echo "--- extracting (verbose) ---"
tar -xvzf "$t" -C "$d"
echo "--- extracted tree ---"
/usr/bin/find "$d" -maxdepth 2 -print | sort
echo "::endgroup::"
done
- name: Stage RelWithDebInfo BqLog.node (+pdb) into wrapper/typescript/prebuilds
shell: bash
run: |
set -euo pipefail
TS_DIR="wrapper/typescript"
PREBUILDS_DIR="$TS_DIR/prebuilds"
mkdir -p "$PREBUILDS_DIR"
map_target() {
# Map archive folder name to prebuilds/<plat-arch>
# Input: archive base name (e.g., PACKAGE-windows-x86_64-1.2.3)
local name="$1"
local lowered="${name,,}"
if [[ "$lowered" == *macos*universal* ]]; then
echo "darwin-universal" # special marker, handled later (copy to two dirs)
elif [[ "$lowered" == *windows*arm64* ]]; then
echo "win32-arm64"
elif [[ "$lowered" == *windows* ]]; then
# default windows x64
echo "win32-x64"
elif [[ "$lowered" == *freebsd* ]]; then
echo "freebsd-x64"
elif [[ "$lowered" == *linux*arm64* ]]; then
echo "linux-arm64"
elif [[ "$lowered" == *linux*x86_64* || "$lowered" == *linux*amd64* ]]; then
echo "linux-x64"
elif [[ "$lowered" == *linux*x86* || "$lowered" == *debian*x86* || "$lowered" == *i386* ]]; then
echo "linux-ia32"
else
# Fallback unknown
echo ""
fi
}
copied_any=0
shopt -s globstar nullglob
for d in extracted/*/*; do
base="$(basename "$d")"
target="$(map_target "$base")"
if [[ -z "$target" ]]; then
echo "Skip: cannot determine prebuild target for $base"
continue
fi
# Find RelWithDebInfo/BqLog.node
mapfile -t nodes < <(find "$d" -type f -path "*/RelWithDebInfo/*" -name "BqLog.node" 2>/dev/null || true)
if (( ${#nodes[@]} == 0 )); then
echo "No RelWithDebInfo/BqLog.node found in $base, skipping."
continue
fi
# Prefer the first match
node_src="${nodes[0]}"
echo "::group::Stage from $base -> $target"
if [[ "$target" == "darwin-universal" ]]; then
for tdir in "darwin-x64" "darwin-arm64"; do
mkdir -p "$PREBUILDS_DIR/$tdir"
cp -f "$node_src" "$PREBUILDS_DIR/$tdir/BqLog.node"
done
else
mkdir -p "$PREBUILDS_DIR/$target"
cp -f "$node_src" "$PREBUILDS_DIR/$target/BqLog.node"
# Optional PDB (Windows builds)
pdb="$(dirname "$node_src")/BqLog.pdb"
if [[ -f "$pdb" ]]; then
cp -f "$pdb" "$PREBUILDS_DIR/$target/BqLog.pdb"
fi
fi
echo "::endgroup::"
copied_any=1
done
if [[ "$copied_any" -ne 1 ]]; then
echo "Error: No prebuilds were staged."
exit 1
fi
- name: List staged prebuilds
run: |
find wrapper/typescript/prebuilds -maxdepth 2 -type f -print | sort
- name: Build NPM
run: |
cd build/wrapper/nodejs
chmod +x *.sh
./build_all_and_pack.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: nodejs_npm
path: ${{ github.workspace }}/dist
# Unity package
unity_package_build:
runs-on: ubuntu-latest
needs: [build_linux_android, build_ios_lib, build_ubuntu_x86_64_lib_Clang, build_mac_lib, build_windows_x86_64_lib_MSVC]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts from native builds
uses: actions/download-artifact@v4
with:
path: downloaded_artifacts
- name: Prepare tools
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y unzip
sudo apt-get install -y nodejs npm
- name: Extract version from source and update package.json
shell: bash
run: |
set -euo pipefail
# Parse version from src/bq_log/global/version.cpp
VERSION="$(sed -n 's/.*BQ_LOG_VERSION *= *"\(.*\)".*/\1/p' src/bq_log/global/version.cpp | head -n1)"
if [[ -z "$VERSION" ]]; then
echo "Failed to extract version from src/bq_log/global/version.cpp"
exit 1
fi
# Make VERSION available to both this and subsequent steps
echo "VERSION=$VERSION" | tee -a "$GITHUB_ENV"
export VERSION
# Update plugin/unity/package.json (ensure VERSION is visible to node)
if [[ -f plugin/unity/package.json ]]; then
VERSION="$VERSION" node -e "const fs=require('fs');const p='plugin/unity/package.json';const j=JSON.parse(fs.readFileSync(p,'utf8'));if(!j.name)throw new Error('package.json missing name');if(!process.env.VERSION)throw new Error('VERSION env missing');j.version=process.env.VERSION;fs.writeFileSync(p,JSON.stringify(j,null,2));console.log('Updated',p,'to version',j.version);"
else
echo 'plugin/unity/package.json not found!' >&2
exit 1
fi
# Sanity check: ensure version exists after write
if ! grep -q '"version"' plugin/unity/package.json; then
echo 'ERROR: version field missing in plugin/unity/package.json after update' >&2
cat plugin/unity/package.json
exit 1
fi
echo 'Sanity check package.json:'
cat plugin/unity/package.json
- name: Extract all archives (zip and tar.gz) with artifact prefix and list contents
shell: bash
run: |
set -euo pipefail
mkdir -p extracted
shopt -s nullglob
# Derive artifact name from downloaded_artifacts/<artifact>/<file>
get_artifact_name() {
local p="$1"
basename "$(dirname "$p")"
}
# Unzip *.zip -> extracted/<artifact>/<base>
for z in downloaded_artifacts/**/*.zip downloaded_artifacts/*.zip; do
artifact="$(get_artifact_name "$z")"
base="$(basename "${z%.*}")"
d="extracted/${artifact}/${base}"
mkdir -p "$d"
echo "::group::Unzip $z -> $d"
unzip -l "$z" || true
unzip -o "$z" -d "$d"
/usr/bin/find "$d" -maxdepth 2 -print | sort
echo "::endgroup::"
done
# Untar *.tgz / *.tar.gz -> extracted/<artifact>/<base>
for t in downloaded_artifacts/**/*.tgz downloaded_artifacts/*.tgz downloaded_artifacts/**/*.tar.gz downloaded_artifacts/*.tar.gz; do
artifact="$(get_artifact_name "$t")"
fname="$(basename "$t")"
base="${fname%.tar.gz}"
base="${base%.tgz}"
d="extracted/${artifact}/${base}"
mkdir -p "$d"
echo "::group::Untar $t -> $d"
echo "Listing contents of $t"
tar -tzf "$t" | sed -n '1,200p' || true
echo "--- extracting (verbose) ---"
tar -xvzf "$t" -C "$d"
echo "--- extracted tree ---"
/usr/bin/find "$d" -maxdepth 2 -print | sort
echo "::endgroup::"
done
- name: Stage libs into plugin/unity/Runtime/Plugins
shell: bash
run: |
set -euo pipefail
: "${VERSION:?VERSION env not set}"
BASE="extracted"
# Target folders
ANDROID_DIR="plugin/unity/Runtime/Plugins/Android"
WIN_X64_DIR="plugin/unity/Runtime/Plugins/Windows/x86_64"
LINUX_X64_DIR="plugin/unity/Runtime/Plugins/Linux/x86_64"
IOS_DIR="plugin/unity/Runtime/Plugins/iOS"
MACOS_DIR="plugin/unity/Runtime/Plugins/macOS"
mkdir -p "$ANDROID_DIR" "$WIN_X64_DIR" "$LINUX_X64_DIR" "$IOS_DIR" "$MACOS_DIR"
copy_one() {
local src="$1"
local dst="$2"
echo "Copy: $src -> $dst/"
mkdir -p "$dst"
cp -a "$src" "$dst/"
}
# Android (.aar) -> rename to bqlog.aar
mapfile -t android_aar < <(find "$BASE" -type f -path "*/bqlog-lib-android-${VERSION}/*/dynamic_lib/*bqlog-release.aar" | sort)
if (( ${#android_aar[@]} )); then
echo "Copy: ${android_aar[0]} -> $ANDROID_DIR/bqlog.aar"
cp -f "${android_aar[0]}" "$ANDROID_DIR/bqlog.aar"
else
echo "WARN: Android AAR not found for version ${VERSION}"
fi
# Windows x86_64 (BqLog.dll + optional BqLog.pdb + optional BqLog.lib)
mapfile -t win_dll < <(find "$BASE" -type f -path "*/bqlog-lib-windows-x86_64-${VERSION}/*/dynamic_lib/lib/RelWithDebInfo/BqLog.dll" | sort)
if (( ${#win_dll[@]} )); then
dll="${win_dll[0]}"
win_dir="$(dirname "$dll")"
mkdir -p "$WIN_X64_DIR"
echo "Copy: $dll -> $WIN_X64_DIR/"
cp -f "$dll" "$WIN_X64_DIR/"
if [[ -f "$win_dir/BqLog.pdb" ]]; then
echo "Copy: $win_dir/BqLog.pdb -> $WIN_X64_DIR/"
cp -f "$win_dir/BqLog.pdb" "$WIN_X64_DIR/"
fi
else
echo "WARN: Windows x86_64 DLL not found for version ${VERSION}"
fi
# Linux x86_64 (libBqLog.so) - use exact versioned real .so (.so.${VERSION}) and copy as libBqLog.so
LINUX_PKG_BASE="$BASE/linux_x86_64_libs/bqlog-lib-linux-x86_64-${VERSION}"
LINUX_INNER_DIR="$LINUX_PKG_BASE/bqlog-lib-linux-x86_64-${VERSION}/dynamic_lib/lib/RelWithDebInfo"
if [[ ! -d "$LINUX_INNER_DIR" ]]; then
echo "ERROR: Expected directory not found: $LINUX_INNER_DIR" >&2
exit 1
fi
REAL_SO="$LINUX_INNER_DIR/libBqLog.so.${VERSION}"
if [[ ! -f "$REAL_SO" ]]; then
echo "ERROR: Expected real .so not found: $REAL_SO" >&2
exit 1
fi
echo "Copy (real .so): $REAL_SO -> $LINUX_X64_DIR/libBqLog.so"
mkdir -p "$LINUX_X64_DIR"
# -L to dereference symlink if any; final name must be libBqLog.so
cp -Lf "$REAL_SO" "$LINUX_X64_DIR/libBqLog.so"
# iOS (BqLog.framework)
mapfile -t ios_fw < <(find "$BASE" -type d -path "*/bqlog-lib-ios-${VERSION}/*/static_lib/lib/RelWithDebInfo/BqLog.framework" | sort)
if (( ${#ios_fw[@]} )); then
copy_one "${ios_fw[0]}" "$IOS_DIR"
else
echo "WARN: iOS framework not found for version ${VERSION}"
fi
# macOS universal (libBqLog.dylib) - use exact versioned real .dylib (BqLog.${VERSION}.dylib) and copy as libBqLog.dylib
MACOS_PKG_BASE="$BASE/macos_universal_binary_libs/bqlog-lib-macos-universal-${VERSION}"
MACOS_INNER_DIR="$MACOS_PKG_BASE/bqlog-lib-macos-universal-${VERSION}/dynamic_lib/lib/RelWithDebInfo"
if [[ ! -d "$MACOS_INNER_DIR" ]]; then
echo "ERROR: Expected directory not found: $MACOS_INNER_DIR" >&2
exit 1
fi
REAL_DYLIB="$MACOS_INNER_DIR/libBqLog.${VERSION}.dylib"
if [[ ! -f "$REAL_DYLIB" ]]; then
echo "ERROR: Expected real .dylib not found: $REAL_DYLIB" >&2
exit 1
fi
echo "Copy (real .dylib): $REAL_DYLIB -> $MACOS_DIR/libBqLog.dylib"
mkdir -p "$MACOS_DIR"
# -L to dereference symlink if any; final name must be libBqLog.dylib
cp -Lf "$REAL_DYLIB" "$MACOS_DIR/libBqLog.dylib"
echo "Staged files/directories (Plugins subtree, up to depth 6):"
/usr/bin/find plugin/unity/Runtime/Plugins -maxdepth 6 -print | sort
- name: Copy source codes
run: |
set -euo pipefail
# Copy the contents of wrapper/csharp/src into Runtime/src (avoid nesting src/src)
mkdir -p plugin/unity/Runtime/src
cp -r wrapper/csharp/src/. plugin/unity/Runtime/src/
- name: Build Unity Package
run: |
set -euo pipefail
echo "Verifying package.json before pack:"
test -f plugin/unity/package.json && cat plugin/unity/package.json || (echo "package.json missing"; exit 1)
echo "::group::npm pack --dry-run"
cd plugin/unity
npm pack --dry-run || true
echo "::endgroup::"
mkdir -p ../../dist/plugins/unity
npm pack --pack-destination ../../dist/plugins/unity
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: unity_package
path: ${{ github.workspace }}/dist