locate wasm/data/so in the same directory with js #39
Workflow file for this run
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
name: ci | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
env: | |
EMSCRIPTEN_VERSION: '3.1.64' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- name: Install dependencies | |
run: | | |
sudo apt install -y clang-format \ | |
ninja-build \ | |
extra-cmake-modules \ | |
gettext | |
npm i -g pnpm | |
pnpm i | |
pnpm --prefix=fcitx5-webview i | |
- name: Lint | |
run: | | |
find src wasmfrontend webpanel -name '*.h' -o -name '*.cpp' | xargs clang-format -Werror --dry-run | |
pnpm run lint | |
pnpm run check | |
- name: Install emsdk | |
run: | | |
git clone https://github.com/emscripten-core/emsdk | |
cd emsdk | |
./emsdk install ${{ env.EMSCRIPTEN_VERSION }} | |
./emsdk activate ${{ env.EMSCRIPTEN_VERSION }} | |
- name: Build | |
run: | | |
./install-deps.sh | |
. emsdk/emsdk_env.sh | |
export EMCC_FORCE_STDLIBS=libc++ | |
export FCITX_DISTRIBUTION=fcitx5-js | |
pushd fcitx5 && git apply ../patches/fcitx5.patch && popd | |
PKG_CONFIG_PATH="build/sysroot/usr/share/pkgconfig;build/sysroot/usr/lib/pkgconfig" emcmake cmake -B build -G Ninja \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_FIND_ROOT_PATH="$(pwd)/build/sysroot/usr" \ | |
-DCMAKE_INSTALL_PREFIX=/usr | |
cmake --build build || true | |
DESTDIR=$(pwd)/build/sysroot cmake --install build/fcitx5 | |
DESTDIR=$(pwd)/build/sysroot cmake --install build/wasmfrontend | |
DESTDIR=$(pwd)/build/sysroot cmake --install build/webpanel | |
cmake --build build | |
npm pack | |
cd build/sysroot/usr && tar cjvf ../../../fcitx5-js-dev.tar.bz2 include lib | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
- name: Release | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: 'marvinpinto/action-automatic-releases@latest' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: latest | |
prerelease: true | |
title: "Nightly Build" | |
files: | | |
fcitx5-js-*.tgz | |
fcitx5-js-dev.tar.bz2 |