Skip to content

NightlyBuildWeekly

NightlyBuildWeekly #1

name: NightlyBuildWeekly
on:
schedule:
- cron: '0 0 * * 1' # 每周一 00:00 UTC 执行
workflow_dispatch:
jobs:
Release:
runs-on: ubuntu-latest
if: github.repository == 'LIPiston/rime-ice'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pack dicts
run: |
## 备用 Prepare opencc dict, 启用后 emoji.json 也要做改动
# apt install opencc
# opencc_dict -i opencc/emoji.txt -o opencc/emoji.ocd2 -f text -t ocd2
mkdir dist
echo "Pack all ..."
find . -maxdepth 1 -name "*.lua" -o -name "*.yaml" -o -name "*.txt" | zip dist/full.zip -@
zip -r dist/full.zip cn_dicts cn_dicts_cell en_dicts lua opencc LICENSE
echo "Pack dicts ..."
zip -r dist/all_dicts.zip cn_dicts en_dicts opencc radical_pinyin.dict.yaml
echo "Pack cn_dicts ..."
zip -r dist/cn_dicts.zip cn_dicts
echo "Pack en_dicts ..."
zip -r dist/en_dicts.zip en_dicts
echo "Pack opencc ..."
zip -r dist/opencc.zip opencc
echo "copy LICENSE and README.md..."
cp LICENSE dist/LICENSE.txt
cp README.md dist/README.md
- name: Get current time (UTC+8)
id: time
run: |
export TZ='Asia/Shanghai'
echo "time=$(date +'%Y-%m-%d %H:%M:%S UTC+8')" >> $GITHUB_OUTPUT
- name: Delete existing nightly release
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release delete nightly -y || echo "No existing nightly release to delete"
- name: Create nightly release
if: ${{ github.ref == 'refs/heads/main' }}
uses: "softprops/action-gh-release@v2"
with:
body: |
## 说明
这里是每次提交后自动打包的版本,包含最新的功能和词库
📅 构建时间:${{ steps.time.outputs.time }}
- `README.md`:简易的使用说明
- `full.zip` : 包含所有词典和方案文件
- `cn_dicts.zip`:中文词库
- `en_dicts.zip`:英文词库
- `opencc.zip`:opencc 词库(emoji 等)
- `all_dicts.zip`:以上四个词库的整合
- `LICENSE.txt`:开源协议
tag_name: nightly
name: "nightly build"
make_latest: true
files: |
dist/*