Merge branch 'weaseldeployerx64' into pb #572
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: Commit CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '![0-9]+.*' | |
paths: | |
- '**/**' | |
- '!*.md' | |
- '!.gitignore' | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-2022 | |
env: | |
librime_build: 'submodule' | |
boost_version: 1.83.0 | |
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_83_0 | |
steps: | |
- name: Checkout last commit | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Configure build environment | |
run: | | |
copy env.vs2022.bat env.bat | |
$git_ref_name = git describe --always | |
echo "git_ref_name=$git_ref_name" >> $env:GITHUB_ENV | |
- name: Cache Boost | |
id: cache-boost | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.BOOST_ROOT }} | |
key: ${{ runner.os }}-boost-${{ env.boost_version }} | |
- name: Install Boost | |
if: steps.cache-boost.outputs.cache-hit != 'true' | |
run: .\install_boost.bat | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v1.1.3 | |
- name: Copy Rime files | |
if: env.librime_build == 'stable' | |
run: .\github.install.bat | |
- name: Build librime 64 bit | |
if: env.librime_build == 'submodule' | |
env: | |
ARCH: x64 | |
RIME_PLUGINS: hchunhui/librime-lua lotem/librime-octagram rime/librime-predict | |
shell: bash | |
run: | | |
# load plugins | |
pushd librime | |
./action-install-plugins-windows.bat | |
popd | |
# build librime | |
./build.bat librime | |
# copy x64 files to weasel and rename | |
echo " ./lib/rimex64.dll" | |
cp ./librime/dist/lib/rime.dll ./lib/rimex64.dll | |
echo " ./lib/rimex64.lib" | |
cp ./librime/dist/lib/rime.lib ./lib/rimex64.lib | |
echo " ./output/x64/rime.dll" | |
cp ./librime/dist/lib/rime.dll ./output/x64/rime.dll | |
- name: Build librime | |
if: env.librime_build == 'submodule' | |
env: | |
ARCH: Win32 | |
RIME_PLUGINS: hchunhui/librime-lua lotem/librime-octagram rime/librime-predict | |
shell: bash | |
run: | | |
# clean x64 | |
rm -rf ./librime/deps/opencc/build/ | |
rm -rf ./librime/deps/glog/build/ | |
rm -rf ./librime/deps/googletest/build/ | |
rm -rf ./librime/deps/leveldb/build/ | |
rm -rf ./librime/deps/marisa-trie/build/ | |
rm -rf ./librime/deps/yaml-cpp/build/ | |
rm -rf ./librime/build/ | |
rm -rf ./librime/lib/*.lib | |
rm -rf ./librime/lib/cmake | |
rm -rf ./librime/lib/pkgconfig | |
rm -rf ./librime/dist | |
# build librime | |
./build.bat librime | |
- name: Build Weasel | |
id: build_weasel | |
shell: bash | |
run: | | |
./build.bat data | |
./build.bat hant | |
./build.bat installer | |
- name: Compress Debug Symbols | |
shell: pwsh | |
run: | | |
Compress-Archive -Path output\*.pdb -CompressionLevel Optimal -DestinationPath .\output\archives\symbols.zip | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
path: | | |
.\output\archives\weasel*.exe | |
.\output\archives\symbols.zip |