chore: update deps #286
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
workflow_dispatch: | |
inputs: | |
disable_de_weight_630: | |
description: '禁用权重降低选项 true / false (默认不禁用)' | |
required: true | |
default: 'false' | |
push: | |
branches: | |
- master | |
- dev | |
tags: | |
- 'v*' | |
jobs: | |
sanity-check: | |
name: Dictionary Sanity Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Sanity Check | |
run: | | |
make check | |
pack-schema: | |
name: Pack Schema | |
runs-on: ubuntu-latest | |
needs: sanity-check | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Make Dicts | |
run: | | |
if [[ "${{ github.event.inputs.disable_de_weight_630 }}" == "true" ]]; then | |
make dicts VERSION=${{ github.ref_name }} | |
else | |
make dicts DEWEIGHT=1 VERSION=${{ github.ref_name }} | |
fi | |
- name: Build Opencc Dependencies | |
run: | | |
sudo apt-get install -y opencc | |
if command -v opencc &> /dev/null; then | |
echo "$(opencc --version)" | |
mkdir -p schema/opencc | |
opencc -c t2s.json -i deps/rime-emoji/opencc/emoji_category.txt | awk '!seen[$1]++' > schema/opencc/emoji_category.txt | |
opencc -c t2s.json -i deps/rime-emoji/opencc/emoji_word.txt | awk '!seen[$1]++' > schema/opencc/emoji_word.txt | |
# https://github.com/rime/rime-emoji/issues/48 | |
sed -i 's/鼔/鼓/g' schema/opencc/emoji_word.txt | |
cp deps/rime-emoji/opencc/emoji.json schema/opencc/ | |
make -C deps/opencc-tonggui | |
cp deps/opencc-tonggui/opencc/* schema/opencc/ | |
fi | |
- name: Make Zip | |
run: | | |
cd schema | |
rm recipe.yaml | |
zip -r -q ../jiandao.zip * -x rime.lua | |
- name: Make Legacy Zip | |
run: | | |
cd schema | |
sed -i 's/*jiandao\///g' jiandao.schema.yaml | |
zip -r -q ../jiandao-legacy.zip * | |
- name: Make Xiaoxiao Zip | |
run: | | |
cd xiaoxiao | |
zip -r -q ../jiandao-xiaoxiao.zip * | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: zips | |
path: | | |
jiandao.zip | |
jiandao-legacy.zip | |
jiandao-xiaoxiao.zip | |
create-release: | |
name: Create Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: pack-schema | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: zips | |
- name: Unzip & Rename Release Zip Archive | |
run: | | |
unzip jiandao.zip -d release | |
mv schema/recipe.yaml release/ | |
mv jiandao.zip jiandao-${{ github.ref_name }}.zip | |
mv jiandao-legacy.zip jiandao-legacy-${{ github.ref_name }}.zip | |
mv jiandao-xiaoxiao.zip jiandao-xiaoxiao-${{ github.ref_name }}.zip | |
cp scripts/installer.bat weasel-installer.bat | |
- name: Create Release and Upload Assets | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
jiandao-${{ github.ref_name }}.zip | |
jiandao-legacy-${{ github.ref_name }}.zip | |
jiandao-xiaoxiao-${{ github.ref_name }}.zip | |
weasel-installer.bat | |
- name: Push to Release | |
uses: s0/[email protected] | |
env: | |
REPO: self | |
BRANCH: release | |
FOLDER: release | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MESSAGE: "Release ${{ github.ref_name }}" |