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 Apr 23, 2024
2 parents 9c9cb6a + 2941162 commit 9f2638c
Show file tree
Hide file tree
Showing 69 changed files with 1,679 additions and 736 deletions.
52 changes: 15 additions & 37 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
build:
runs-on: windows-2022
runs-on: windows-2019
env:
librime_build: 'submodule'
boost_version: 1.84.0
Expand All @@ -25,8 +25,15 @@ jobs:
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-17.0.6

- name: Install llvm
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: choco install llvm --version=17.0.6

- name: Code style lint
Expand All @@ -36,10 +43,7 @@ jobs:
- name: Configure build environment
shell: bash
run: |
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
cp env.vs2019.bat env.bat
- name: Cache Boost
id: cache-boost
Expand All @@ -61,45 +65,19 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

# 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' && steps.cache-librime.outputs.cache-hit != 'true' }}
env:
RIME_PLUGINS: hchunhui/librime-lua lotem/librime-octagram rime/librime-predict
shell: bash
# use upper stream released librime files if stable release
- name: Copy Rime files
run: |
# load plugins
pushd librime
./action-install-plugins-windows.bat
popd
./build.bat librime
.\github.install.bat
# build librime if cached
- name: Copy librime built files cached
if: ${{ env.librime_build == 'submodule' && steps.cache-librime.outputs.cache-hit == 'true' }}
shell: bash
- name: Build data
run: |
cp ./librime/dist/lib/rime* ./lib/
cp ./librime/dist/lib/rime.dll ./output/
cp ./librime/dist/include/*.h ./include/
.\build.bat data
- name: Build Weasel
id: build_weasel
shell: bash
run: |
./build.bat data
./build.bat hant arm64
./build.bat installer
.\build.bat hant arm64 installer
- name: Compress Debug Symbols
shell: pwsh
Expand Down
56 changes: 15 additions & 41 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build-and-release:
permissions:
contents: write
runs-on: windows-2022
runs-on: windows-2019
env:
librime_build: submodule
boost_version: 1.84.0
Expand All @@ -26,10 +26,7 @@ jobs:
- name: Configure build environment
shell: bash
run: |
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
cp env.vs2019.bat env.bat
# cache boost
- name: Cache Boost
Expand All @@ -54,49 +51,26 @@ jobs:

# use upper stream released librime files if stable release
- name: Copy Rime files
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: ${{ 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
- name: Build data
run: |
# load plugins
pushd librime
./action-install-plugins-windows.bat
popd
./build.bat librime
.\build.bat data
# 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
- name: Build Weasel Release
id: build_weasel
if: startsWith(github.ref, 'refs/tags/')
env:
RELEASE_BUILD: 1
run: |
cp ./librime/dist/lib/rime* ./lib/
cp ./librime/dist/lib/rime.dll ./output/
cp ./librime/dist/include/*.h ./include/
.\build.bat hant arm64 installer
- name: Build Weasel
id: build_weasel
shell: bash
- name: Build Weasel Nightly
id: build_weasel_nightly
if: github.ref == 'refs/heads/master'
run: |
./build.bat data
./build.bat hant arm64
./build.bat installer
.\build.bat hant arm64 installer
- name: Compress Debug Symbols
shell: pwsh
Expand All @@ -111,7 +85,7 @@ jobs:

# create nightly release
- name: Create Nightly release
if: github.ref == 'refs/heads/master'
if: ${{ github.repository == 'rime/weasel' && github.ref == 'refs/heads/master' }}
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Loading

0 comments on commit 9f2638c

Please sign in to comment.