forked from rime/weasel
-
Notifications
You must be signed in to change notification settings - Fork 23
122 lines (107 loc) · 3.41 KB
/
commit-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Commit CI
on:
workflow_dispatch:
push:
branches:
- '*'
tags:
- '![0-9]+.*'
paths:
- '**/**'
- '!*.md'
- '!.gitignore'
pull_request:
jobs:
build:
runs-on: windows-2019
env:
librime_build: 'submodule'
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: Install llvm
run: choco install llvm --version=17.0.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
#librime_id=$(git submodule foreach --quiet 'if [ $name == "librime" ]; then echo `git rev-parse HEAD`; fi')
#echo "librime_id is $librime_id"
#echo "librime_id=$librime_id" >> $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
run: |
.\github.install.bat
# cache librime
#- name: Cache librime
# if: env.librime_build == 'submodule'
# id: cache-librime
# uses: actions/cache@v4
# with:
# path: |
# librime
# key: ${{ runner.os }}-librime-${{ env.librime_id }}-dual
# build librime if not cached
#- name: Build librime
# if: ${{ env.librime_build == 'submodule' && steps.cache-librime.outputs.cache-hit != 'true' }}
# env:
# 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.bat librime
# build librime if cached
#- name: Copy librime built files cached
# if: ${{ env.librime_build == 'submodule' && steps.cache-librime.outputs.cache-hit == 'true' }}
# shell: bash
# run: |
# cp ./librime/dist_x64/lib/rime* ./lib64/
# cp ./librime/dist_x64/lib/rime.dll ./output/
# cp ./librime/dist_x64/include/*.h ./include/
# cp ./librime/dist_Win32/lib/rime* ./lib/
# cp ./librime/dist_Win32/lib/rime.dll ./output/Win32/
- name: Build Weasel
id: build_weasel
shell: bash
run: |
./build.bat data
./build.bat hant arm64
./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@v4
with:
if-no-files-found: error
path: |
.\output\archives\weasel*.exe
.\output\archives\symbols.zip