chaizi_update #70
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: Build and Release | |
on: | |
push: | |
tags: | |
- '[0-9]+.*' | |
workflow_dispatch: | |
repository_dispatch: | |
types: [chaizi_update] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.TOKEN }} | |
ref: 'build' | |
fetch-depth: '0' | |
submodules: true | |
- name: Set up git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Update submodule | |
if: github.event_name == 'repository_dispatch' | |
run: | | |
cd dict | |
git checkout master | |
git pull | |
- name: Update tag | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
$Date = Get-Date -Format yyyy.MM.dd | |
Write-output "${{ github.ref_name }}" | |
"# v${{ github.ref_name }} -> $Date" >> 'info.yaml' | |
(gc radical.schema.yaml -Raw) -replace 'version: "\d\.\d\.\d"',"version: `"${{ github.ref_name }}`"" | Out-File radical.schema.yaml | |
(gc radical_pinyin.schema.yaml -Raw) -replace 'version: "\d\.\d\.\d"',"version: `"${{ github.ref_name }}`"" | Out-File radical_pinyin.schema.yaml | |
- name: Update build branch | |
run: | | |
$Status = git status --porcelain | |
if ( $Status ) { | |
"Update submodule" | |
$info = (irm https://whatthecommit.com/index.txt).trim() | |
git add --all | |
git commit -m "$info" && git push origin build | |
} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: 'pip' | |
- name: Build | |
run: | | |
make | |
- name: Update | |
run: | | |
$ErrorActionPreference = 'Break' | |
# $CommitInfo = Get-Date -UFormat %s | |
$CommitInfo = (irm https://whatthecommit.com/index.txt).trim() | |
git checkout master | |
cp gen/radical_pinyin.dict.yaml , gen/radical_pinyin.schema.yaml | |
cp gen/radical_flypy.dict.yaml, gen/radical.schema.yaml | |
$Status = git status --porcelain | |
if ( $Status ) { | |
"Push to master branch" | |
git add --all | |
git commit -m "$CommitInfo" && git push origin master | |
} | |
Compress-Archive "radical_pinyin.schema.yaml","radical_pinyin.dict.yaml" "gen/radical_pinyin.zip" | |
Compress-Archive "radical_flypy.dict.yaml","radical.schema.yaml" "gen/radical_flypy.zip" | |
Compress-Archive "lua", "build" "gen/extra.zip" | |
- name: Create Nightly release | |
if: ${{ ! startsWith(github.ref, 'refs/tags/') }} | |
uses: 'softprops/action-gh-release@v2.0.4' | |
with: | |
body: | | |
您正在查看的是 v2 发布版。收字更全,**当前部分数据未经校对**。覆盖 Unihan 40,000 汉字。 | |
旧版仍在维护,请查看 v1 分支和 1.x 发布版。其包含繁简 21,000+ 汉字,足够日常使用。 | |
## 说明 | |
- 经校对测试、补全的开放词典拆字数据 | |
- 未经校对的 idc 部分数据 | |
- https://gitlab.chise.org/CHISE/ids (GPLv2 or later) | |
- https://github.com/yi-bai/ids (MIT) | |
## 文件 | |
- `radical_pinyin.zip` : 包含全拼双拼的方案和词库 | |
- `radical_flypy.zip`:仅适用于小鹤双拼的方案和词库 | |
- `extra.zip`:辅码反查 lua 和带声调的 build 文件 | |
tag_name: nightly | |
name: "nightly build" | |
make_latest: true | |
prerelease: false | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: | | |
gen/*.zip | |
- name: Create Stable release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: 'softprops/action-gh-release@v2.0.4' | |
with: | |
body: | | |
您正在查看的是 v2 发布版。收字更全,**当前部分数据未经校对**。覆盖 Unihan 40,000 汉字。 | |
旧版仍在维护,请查看 v1 分支和 1.x 发布版。其包含繁简 21,000+ 汉字,足够日常使用。 | |
## 说明 | |
- 经校对测试、补全的开放词典拆字数据 | |
- 未经校对的 idc 部分数据 | |
- https://gitlab.chise.org/CHISE/ids (GPLv2 or later) | |
- https://github.com/yi-bai/ids (MIT) | |
## 文件 | |
- `radical_pinyin.zip` : 包含全拼双拼的方案和词库 | |
- `radical_flypy.zip`:仅适用于小鹤双拼的方案和词库 | |
- `extra.zip`:辅码反查 lua 和带声调的 build 文件 | |
generate_release_notes: true | |
draft: true | |
prerelease: false | |
make_latest: true | |
fail_on_unmatched_files: true | |
files: | | |
gen/*.zip | |
- name: Error Handling | |
if: ${{ failure() }} | |
run: exit 1 |