Skip to content

Commit CI

Commit CI #855

Workflow file for this run

name: Commit CI
on:
workflow_dispatch:
push:
branches:
- '*'
tags:
- '![0-9]+.*'
paths:
- '**/**'
- '!*.md'
- '!.gitignore'
pull_request:
jobs:
build:
runs-on: windows-2019
env:
boost_version: 1.84.0
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_84_0
steps:
- name: Checkout last commit
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache llvm
id: cache-llvm
uses: actions/cache@v4
with:
path: C:\\Program Files\\LLVM
key: ${{ runner.os }}-llvm-18.1.6
- name: Install llvm
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: choco install llvm --version=18.1.6
- name: Code style lint
shell: bash
run: ./clang-format.sh -i
- name: Configure build environment
shell: bash
run: |
cp env.vs2019.bat env.bat
echo git_ref_name="$(git describe --always)" >> $GITHUB_ENV
- name: Cache Boost
id: cache-boost
uses: actions/cache@v4
with:
path: |
${{ env.BOOST_ROOT }}
key: ${{ runner.os }}-boost-${{ env.boost_version }}
# install boost if not cached
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
shell: bash
run: |
./install_boost.bat
./build.bat boost arm64
# add msbuild to PATH
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
# use upper stream released librime files if stable release
- name: Copy Rime files
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
.\get-rime.ps1 -tag latest -extract $true
$dir86 = Get-ChildItem -Path ".\rime*x86" -Directory
$dir64 = Get-ChildItem -Path ".\rime*x64" -Directory
copy $dir86\dist\include\rime_*.h include\
copy $dir86\dist\lib\rime.lib lib\
copy $dir86\dist\lib\rime.dll output\Win32\
copy $dir86\dist\lib\rime.pdb output\Win32\
copy $dir64\dist\lib\rime.lib lib64\
copy $dir64\dist\lib\rime.dll output\
copy $dir64\dist\lib\rime.pdb output\
if (-not (Test-Path -Path "output\data\opencc")) {
New-Item -ItemType Directory -Path "output\data\opencc"
}
copy $dir64\share\opencc\*.* output\data\opencc\
- name: Build data
run: |
$ErrorActionPreference = 'Stop'
.\build.bat data
- name: Build Weasel
id: build_weasel
run: |
$ErrorActionPreference = 'Stop'
.\build.bat arm64 installer
- name: Compress Debug Symbols
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
output\7z.exe a -t7z "./output/archives/debug_symbols.7z" "output/*.pdb" -r
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: weasel-artifact-${{ env.git_ref_name }}
if-no-files-found: error
path: |
.\output\archives\weasel*.exe
.\output\archives\debug_symbols.7z