Merge pull request #127 from xkinput/update-dict-2026-06-16-6700b0b7-… #34
Workflow file for this run
This file contains hidden or 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: Release Packages | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g., v1.0.0)' | |
| required: true | |
| default: 'v1.0.0' | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install rime_deployer and lua | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y librime-bin librime-data lua5.4 | |
| - name: Validate schemas and Lua | |
| run: bash scripts/validate.sh | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| needs: validate | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get version | |
| id: version | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Build packages | |
| run: bash scripts/release.sh ${{ steps.version.outputs.VERSION }} | |
| - name: Get latest commit message | |
| id: commit_msg | |
| run: | | |
| MSG=$(git log -1 --pretty=format:"%s") | |
| echo "msg=${MSG}" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.version.outputs.VERSION }} | |
| name: KeyTao ${{ steps.version.outputs.VERSION }} | |
| body: | | |
| > ${{ steps.commit_msg.outputs.msg }} | |
| ## KeyTao 输入法方案 ${{ steps.version.outputs.VERSION }} | |
| ### 安装说明 | |
| 下载对应平台的压缩包,解压后将所有文件复制到您的 Rime 用户目录,然后重新部署即可使用。 | |
| #### 各平台 Rime 用户目录位置: | |
| - **Linux (Fcitx5-rime)**: `~/.local/share/fcitx5/rime/` | |
| - **Linux (iBus-rime)**: `~/.config/ibus/rime/` | |
| - **macOS (鼠须管)**: `~/Library/Rime/` | |
| - **Windows (小狼毫)**: `%APPDATA%\Rime\` | |
| - **Android (同文)**: `/storage/emulated/0/rime/` | |
| ### 文件说明 | |
| - `keytao-linux-*.zip` - Linux 平台专用版本 | |
| - `keytao-mac-*.zip` - macOS 平台专用版本 | |
| - `keytao-windows-*.zip` - Windows 平台专用版本 | |
| - `keytao-android-*.zip` - Android 平台专用版本 | |
| - `keytao-ios-*.zip` - iOS / iPad 平台专用版本(元书输入法) | |
| - `checksums.txt` - SHA256 校验 | |
| ### 更新内容 | |
| 请查看 [提交历史](https://github.com/${{ github.repository }}/commits/${{ steps.version.outputs.VERSION }}) 了解详细更新。 | |
| files: | | |
| release/keytao-*.zip | |
| release/checksums.txt | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Gitee Release and upload assets | |
| env: | |
| GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }} | |
| VERSION: ${{ steps.version.outputs.VERSION }} | |
| run: | | |
| RELEASE_BODY="KeyTao 输入法方案 ${VERSION},下载对应平台压缩包解压后复制到 Rime 用户目录重新部署即可。" | |
| RESPONSE=$(curl -s -X POST \ | |
| "https://gitee.com/api/v5/repos/xkinput/KeyTao/releases" \ | |
| -F "access_token=${GITEE_TOKEN}" \ | |
| -F "tag_name=${VERSION}" \ | |
| -F "name=KeyTao ${VERSION}" \ | |
| -F "body=${RELEASE_BODY}" \ | |
| -F "target_commitish=master") | |
| RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id') | |
| if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then | |
| echo "Failed to create Gitee release: $RESPONSE" | |
| exit 1 | |
| fi | |
| echo "Gitee release created, id=$RELEASE_ID" | |
| for file in release/keytao-*.zip release/checksums.txt; do | |
| echo "Uploading $file ..." | |
| UPLOAD_RESP=$(curl -s -X POST \ | |
| "https://gitee.com/api/v5/repos/xkinput/KeyTao/releases/${RELEASE_ID}/attach_files?access_token=${GITEE_TOKEN}" \ | |
| -F "file=@${file}") | |
| echo "$UPLOAD_RESP" | |
| done |