|
| 1 | +name: NightlyBuild |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * 1' # 每周一 00:00 UTC 执行 |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + Release: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + if: github.repository == 'LIPiston/rime-ice' |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Pack dicts |
| 18 | + run: | |
| 19 | + ## 备用 Prepare opencc dict, 启用后 emoji.json 也要做改动 |
| 20 | + # apt install opencc |
| 21 | + # opencc_dict -i opencc/emoji.txt -o opencc/emoji.ocd2 -f text -t ocd2 |
| 22 | +
|
| 23 | + mkdir dist |
| 24 | + echo "Pack all ..." |
| 25 | + find . -maxdepth 1 -name "*.lua" -o -name "*.yaml" -o -name "*.txt" | zip dist/full.zip -@ |
| 26 | + zip -r dist/full.zip cn_dicts cn_dicts_cell en_dicts lua opencc LICENSE |
| 27 | + echo "Pack dicts ..." |
| 28 | + zip -r dist/all_dicts.zip cn_dicts en_dicts opencc radical_pinyin.dict.yaml |
| 29 | + echo "Pack cn_dicts ..." |
| 30 | + zip -r dist/cn_dicts.zip cn_dicts |
| 31 | + echo "Pack cn_dicts_cell ..." |
| 32 | + zip -r dist/cn_dicts_cell.zip cn_dicts_cell |
| 33 | + echo "Pack en_dicts ..." |
| 34 | + zip -r dist/en_dicts.zip en_dicts |
| 35 | + echo "Pack opencc ..." |
| 36 | + zip -r dist/opencc.zip opencc |
| 37 | + echo "copy LICENSE and README.md..." |
| 38 | + cp LICENSE dist/LICENSE.txt |
| 39 | + cp README.md dist/README.md |
| 40 | +
|
| 41 | + - name: Create nightly release |
| 42 | + if: ${{ github.ref == 'refs/heads/main' }} |
| 43 | + uses: "softprops/action-gh-release@v2" |
| 44 | + with: |
| 45 | + body: | |
| 46 | + ## 说明 |
| 47 | +
|
| 48 | + 这里是每次提交后自动打包的版本,包含最新的功能和词库 |
| 49 | +
|
| 50 | + - `README.md`:简易的使用说明 |
| 51 | + - `full.zip` : 包含所有词典和方案文件 |
| 52 | + - `cn_dicts.zip`:中文词库 |
| 53 | + - 'cn_dicts_cell.zip':中文词库(搜狗细胞词库) |
| 54 | + - `en_dicts.zip`:英文词库 |
| 55 | + - `opencc.zip`:opencc 词库(emoji 等) |
| 56 | + - `all_dicts.zip`:以上四个词库的整合 |
| 57 | + - `LICENSE.txt`:开源协议 |
| 58 | +
|
| 59 | + tag_name: nightly |
| 60 | + name: "nightly build" |
| 61 | + make_latest: true |
| 62 | + files: | |
| 63 | + dist/* |
0 commit comments