Skip to content

fix: could not restart server by calling WeaselServer.exe #22

fix: could not restart server by calling WeaselServer.exe

fix: could not restart server by calling WeaselServer.exe #22

Workflow file for this run

name: Release CI
on:
push:
branches:
- master
tags:
- '[0-9]+.*'
workflow_dispatch:
jobs:
build-and-release:
permissions:
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:
- name: Checkout last commit
uses: actions/checkout@v4
with:
submodules: recursive
- 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
# cache boost
- 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'
run: .\install_boost.bat
# 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
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
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: ${{ 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 installer
- name: Compress Debug Symbols
shell: pwsh
run: |
Compress-Archive -Path output\*.pdb -CompressionLevel Optimal -DestinationPath .\output\archives\symbols.zip
- name: Extract changelog
shell: pwsh
run: |
.\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'
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: "Nightly Build"
files: |
./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/')
with:
files: |
./output/archives/weasel*.exe
./output/archives/symbols.zip
body_path: ${{ github.workspace }}/RELEASE_CHANGELOG.md