Skip to content

Commit

Permalink
ci: build librime from submodule
Browse files Browse the repository at this point in the history
added env var librime_build=(stable|submodule) for switching between the
two options of preparing librime.
  • Loading branch information
lotem committed Feb 7, 2024
1 parent b24b618 commit 2c69049
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ jobs:
build:
runs-on: windows-2022
env:
librime_build: 'submodule'
boost_version: 1.83.0
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_83_0
steps:
- name: Checkout last commit
uses: actions/checkout@v3
with:
submodules: true
submodules: recursive

- name: Configure build environment
run: |
Expand All @@ -47,21 +48,31 @@ jobs:
uses: microsoft/setup-msbuild@v1.1.3

- name: Copy Rime files
if: env.librime_build == 'stable'
run: .\github.install.bat

- name: Build librime
if: env.librime_build == 'submodule'
env:
RIME_PLUGINS: hchunhui/librime-lua lotem/librime-octagram rime/librime-predict
run: |
# load plugins
pushd librime
.\action-install-plugins-windows.bat
popd
.\build.bat librime
- name: Build Weasel
id: build_weasel
run: |
.\build.bat data
.\build.bat hant
.\build.bat installer
if: ${{ success() }}
- name: Compress Debug Symbols
shell: pwsh
run: |
Compress-Archive -Path output\*.pdb -CompressionLevel Optimal -DestinationPath .\output\archives\symbols.zip
if: ${{ success() }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
Expand All @@ -70,4 +81,3 @@ jobs:
path: |
.\output\archives\weasel*.exe
.\output\archives\symbols.zip
if: ${{ success() }}
28 changes: 20 additions & 8 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
contents: write
runs-on: windows-2022
env:
librime_build: submodule
boost_version: 1.83.0
BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_83_0
steps:
Expand Down Expand Up @@ -44,30 +45,41 @@ jobs:
uses: microsoft/setup-msbuild@v1.1.3

- name: Copy Rime files
run: .\github.install.bat
if: env.librime_build == 'stable'
run: |
.\github.install.bat
- name: Build librime
if: env.librime_build == 'submodule'
env:
RIME_PLUGINS: hchunhui/librime-lua lotem/librime-octagram rime/librime-predict
run: |
# load plugins
pushd librime
.\action-install-plugins-windows.bat
popd
.\build.bat librime
- name: Build Weasel
id: build_weasel
run: |
.\build.bat data
.\build.bat hant
.\build.bat installer
if: ${{ success() }}

- name: Compress Debug Symbols
shell: pwsh
run: |
Compress-Archive -Path output\*.pdb -CompressionLevel Optimal -DestinationPath .\output\archives\symbols.zip
if: ${{ success() }}

- name: Extract changelog
shell: pwsh
run: |
.\extract_changelog.ps1
if: ${{ startsWith(github.ref, 'refs/tags/') && success() }}
if: startsWith(github.ref, 'refs/tags/')

- name: Create Nightly release
if: ${{ github.ref == 'refs/heads/master' && success() }}
if: github.ref == 'refs/heads/master'
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -80,7 +92,7 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/') && success() }}
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./output/archives/weasel*.exe
Expand Down

0 comments on commit 2c69049

Please sign in to comment.