Skip to content

Commit

Permalink
commit ci with librime nightly built
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Feb 7, 2024
1 parent a885a63 commit 5b9c8fa
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 34 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: build librime
if: ${{ success() }}
- name: Build librime
if: ${{ startsWith(github.ref, 'refs/tags/') && success() }}
env:
rime_plugins: hchunhui/librime-lua lotem/librime-octagram rime/librime-predict
run: |
Expand All @@ -56,11 +56,17 @@ jobs:
.\action-install-plugins-windows.bat
popd
.\build.bat librime
.\build.bat opencc
- name: Copy Rime files(Nightly Build)
if: ${{ !startsWith(github.ref, 'refs/tags/') && success() }}
run: |
.\github.install.bat
- name: Build Weasel
id: build_weasel
run: |
.\build.bat opencc
#.\build.bat opencc
.\build.bat data
.\build.bat hant
.\build.bat installer
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,27 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: build librime
if: ${{ success() }}
- name: Build librime
if: ${{ startsWith(github.ref, 'refs/tags/') && success() }}
env:
rime_plugins: hchunhui/librime-lua lotem/librime-octagram rime/librime-predict
run: |
# load plugins
pushd librime\plugins\
git clone -v --depth=1 https://github.com/hchunhui/librime-lua.git
git clone -v --depth=1 -b thirdparty https://github.com/hchunhui/librime-lua.git librime-lua\thirdparty
git clone -v --depth=1 https://github.com/rime/librime-predict.git
git clone -v --depth=1 https://github.com/lotem/librime-octagram.git
pushd librime
.\action-install-plugins-windows.bat
popd
.\build.bat librime
.\build.bat opencc
- name: Copy Rime files(Nightly Build)
if: ${{ !startsWith(github.ref, 'refs/tags/') && success() }}
run: |
.\github.install.bat
- name: Build Weasel
id: build_weasel
run: |
.\build.bat opencc
#.\build.bat opencc
.\build.bat data
.\build.bat hant
.\build.bat installer
Expand Down
63 changes: 40 additions & 23 deletions github.install.bat
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
setlocal

git submodule init
git submodule update plum

set rime_version=1.9.0

set download_archive=rime-a608767-Windows-msvc.7z
set download_archive_deps=rime-deps-a608767-Windows-msvc.7z

curl -LO https://github.com/rime/librime/releases/download/%rime_version%/%download_archive%
curl -LO https://github.com/rime/librime/releases/download/%rime_version%/%download_archive_deps%

7z x %download_archive% * -olibrime\ -y
7z x %download_archive_deps% * -olibrime\ -y

copy /Y librime\dist\include\rime_*.h include\
copy /Y librime\dist\lib\rime.lib lib\
copy /Y librime\dist\lib\rime.dll output\

if not exist output\data\opencc mkdir output\data\opencc
copy /Y librime\share\opencc\*.* output\data\opencc\

setlocal

git submodule init
git submodule update plum

rem set rime_version=1.9.0
rem
rem set download_archive=rime-a608767-Windows-msvc.7z
rem set download_archive_deps=rime-deps-a608767-Windows-msvc.7z

setlocal enabledelayedexpansion
rem fetch librime nightly build
set rime_version=latest
pushd librime
git pull -v origin master
popd
set "filePath=.git/modules/librime/refs/heads/master"

for /f "delims=" %%i in (%filePath%) do (
set "fileContent=%%i"
set "latestCommitId=!fileContent:~0,7!"
goto :breakLoop
)
:breakLoop
set download_archive=rime-%latestCommitId%-Windows-msvc.7z
set download_archive_deps=rime-deps-%latestCommitId%-Windows-msvc.7z

curl -LO https://github.com/rime/librime/releases/download/%rime_version%/%download_archive%
curl -LO https://github.com/rime/librime/releases/download/%rime_version%/%download_archive_deps%

7z x %download_archive% * -olibrime\ -y
7z x %download_archive_deps% * -olibrime\ -y

copy /Y librime\dist\include\rime_*.h include\
copy /Y librime\dist\lib\rime.lib lib\
copy /Y librime\dist\lib\rime.dll output\

if not exist output\data\opencc mkdir output\data\opencc
copy /Y librime\share\opencc\*.* output\data\opencc\

0 comments on commit 5b9c8fa

Please sign in to comment.