Skip to content

Commit

Permalink
Merge branch 'rime:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
alpzmj9 authored Feb 29, 2024
2 parents 51a2cd9 + 9283ae1 commit d522124
Show file tree
Hide file tree
Showing 142 changed files with 18,044 additions and 14,667 deletions.
2 changes: 2 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BasedOnStyle: Chromium
SortIncludes: false
9 changes: 9 additions & 0 deletions .exclude_pattern.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
stdafx
targetver
resource.h
winapifamily
winpackagefamily
winsparkle
immdev.h
SystemTraySDK.h
ctffunc.h
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# apply clang format
9265953e2171c09d07b4cc055375c61923f3c848

60 changes: 45 additions & 15 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,62 @@ jobs:
runs-on: windows-2022
env:
librime_build: 'submodule'
boost_version: 1.83.0
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_83_0
boost_version: 1.84.0
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_84_0
steps:
- name: Checkout last commit
uses: actions/checkout@v3
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: |
copy env.vs2022.bat env.bat
$git_ref_name = git describe --always
echo "git_ref_name=$git_ref_name" >> $env:GITHUB_ENV
cp env.vs2022.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@v3
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'
run: .\install_boost.bat
shell: bash
run: |
./install_boost.bat
./build.bat boost arm64
# add msbuild to PATH
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
uses: microsoft/setup-msbuild@v2

- name: Copy Rime files
if: env.librime_build == 'stable'
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 }}

# build librime if not cached
- name: Build librime
if: env.librime_build == 'submodule'
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
Expand All @@ -63,12 +84,21 @@ jobs:
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/lib/rime* ./lib/
cp ./librime/dist/lib/rime.dll ./output/
cp ./librime/dist/include/*.h ./include/
- name: Build Weasel
id: build_weasel
shell: bash
run: |
./build.bat data
./build.bat hant
./build.bat hant arm64
./build.bat installer
- name: Compress Debug Symbols
Expand All @@ -77,7 +107,7 @@ jobs:
Compress-Archive -Path output\*.pdb -CompressionLevel Optimal -DestinationPath .\output\archives\symbols.zip
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: |
Expand Down
57 changes: 44 additions & 13 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,62 @@ jobs:
runs-on: windows-2022
env:
librime_build: submodule
boost_version: 1.83.0
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_83_0
boost_version: 1.84.0
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_84_0
steps:
- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
submodules: recursive

- name: Configure build environment
shell: bash
run: |
copy env.vs2022.bat env.bat
$git_ref_name = git describe --always
echo "git_ref_name=$git_ref_name" >> $env:GITHUB_ENV
cp env.vs2022.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
# cache boost
- name: Cache Boost
id: cache-boost
uses: actions/cache@v3
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'
run: .\install_boost.bat
shell: bash
run: |
./install_boost.bat
./build.bat boost arm64
# add msbuild to PATH
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1.3
uses: microsoft/setup-msbuild@v2

# use upper stream released librime files if stable release
- name: Copy Rime files
if: env.librime_build == 'stable'
if: ${{ startsWith(github.ref, 'refs/tags/') || env.librime_build == 'stable' }}
run: |
.\github.install.bat
# cache librime for nightly build and not stable release
- name: Cache librime
if: ${{ github.ref == 'refs/heads/master' && env.librime_build == 'submodule' }}
id: cache-librime
uses: actions/cache@v4
with:
path: |
librime
key: ${{ runner.os }}-librime-${{ env.librime_id }}

# build librime if not cached for nightly build and not stable release
- name: Build librime
if: env.librime_build == 'submodule'
if: ${{ github.ref == 'refs/heads/master' && 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
Expand All @@ -61,12 +81,21 @@ jobs:
popd
./build.bat librime
# build librime if cached
- name: Copy librime built files cached
if: ${{ github.ref == 'refs/heads/master' && env.librime_build == 'submodule' && steps.cache-librime.outputs.cache-hit == 'true' }}
shell: bash
run: |
cp ./librime/dist/lib/rime* ./lib/
cp ./librime/dist/lib/rime.dll ./output/
cp ./librime/dist/include/*.h ./include/
- name: Build Weasel
id: build_weasel
shell: bash
run: |
./build.bat data
./build.bat hant
./build.bat hant arm64
./build.bat installer
- name: Compress Debug Symbols
Expand All @@ -80,6 +109,7 @@ jobs:
.\extract_changelog.ps1
if: startsWith(github.ref, 'refs/tags/')

# create nightly release
- name: Create Nightly release
if: github.ref == 'refs/heads/master'
uses: 'marvinpinto/action-automatic-releases@latest'
Expand All @@ -92,6 +122,7 @@ jobs:
./output/archives/weasel*.exe
./output/archives/symbols.zip
# create stable release
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ release-notes.html
*.7z
RELEASE_CHANGELOG.md
deps/
arm64x_wrapper/*.o
arm64x_wrapper/*.dll
arm64x_wrapper/*.ime
arm64x_wrapper/*.lib
arm64x_wrapper/*.exp
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
with components *ATL*, *MFC* and *Windows XP support*.
Visual Studio 2015 or later versions may work with additional configuration.

- Install dev tools: `git`, `cmake`
- Install dev tools: `git`, `cmake``clang-format(>=17.0.6)`

- Download third-party libraries: `boost(>=1.60.0)`

Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

選取輸入法指示器菜單裏的【中】字樣圖標,開始用小狼毫寫字。

可通過快捷鍵 <code>Ctrl+`</code> 或 <code>F4</code> 呼出方案選單、切換輸入方式。
可通過快捷鍵 <kbd>Ctrl+`</kbd> 或 <kbd>F4</kbd> 呼出方案選單、切換輸入方式。

定製輸入法
----------
Expand All @@ -45,7 +45,7 @@

修改詞庫、配置文件後,須「重新部署」方可生效。

定製 Rime 的方法,請參考 Wiki [《定製指南》](https://github.com/rime/home/wiki/CustomizationGuide)
定製 Rime 的方法,請參考 Wiki [《定製指南》](https://github.com/rime/home/wiki/CustomizationGuide)。如需定製 Weasel 獨有的樣式和行為,請參考本倉庫 [Wiki 頁面](https://github.com/rime/weasel/wiki)

致謝
----
Expand Down Expand Up @@ -112,10 +112,6 @@ Rime 輸入法(不限於 Windows 平臺)功能、使用方法與配置相關
聯繫方式
--------

加入聊天室,提出疑問,發表建議或感想
[![Join the chat at https://gitter.im/rime/home](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/rime/home?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

其他技術交流請寄 Rime 開發者 <[email protected]>
技術交流,歡迎光臨 [Rime 代碼之家](https://github.com/rime/home),或致信 Rime 開發者 <[email protected]>

謝謝!

Loading

0 comments on commit d522124

Please sign in to comment.