feat(tip): support zh-CN language profile #837
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: CI | |
| env: | |
| VER_MAJOR: 26 | |
| VER_MINOR: 1 | |
| VER_PATCH: 3 | |
| LLVM_MINGW_VERSION: 20251216 | |
| on: | |
| push: | |
| branches: ["master", "stable/*"] | |
| pull_request: | |
| branches: ["master", "stable/*"] | |
| merge_group: | |
| types: [checks_requested] | |
| workflow_call: | |
| inputs: | |
| nightly: | |
| description: "Update all submodules to build nightly build" | |
| default: true | |
| required: true | |
| type: boolean | |
| outputs: | |
| unsigned-artifact-id: | |
| description: "Unsigned Installer" | |
| value: ${{ jobs.package.outputs.unsigned-artifact-id }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build | |
| steps: | |
| - name: Cache llvm-mingw | |
| id: cache-llvm-linux | |
| uses: actions/cache@v5 | |
| with: | |
| path: /opt/llvm-mingw | |
| key: llvm-mingw-${{ runner.os }}-${{ env.LLVM_MINGW_VERSION }} | |
| - name: Install llvm-mingw ${{ env.LLVM_MINGW_VERSION }} | |
| if: steps.cache-llvm-linux.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p /opt/llvm-mingw | |
| cd /opt/llvm-mingw | |
| curl -L https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_VERSION}/llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-ubuntu-22.04-x86_64.tar.xz | tar xJ --strip-components=1 | |
| - name: Setup llvm-mingw | |
| run: | | |
| echo "/opt/llvm-mingw/bin" >> $GITHUB_PATH | |
| - name: Setup rust targets | |
| run: | | |
| rustup set auto-self-update disable | |
| rustup target add i686-pc-windows-gnullvm | |
| rustup target add x86_64-pc-windows-gnullvm | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Install build dependencies | |
| run: | | |
| cargo install --locked chewing-cli | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: true | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| . | |
| editor/src-tauri | |
| preferences/src-tauri | |
| - name: Install NPM dependencies | |
| run: | | |
| cd preferences | |
| npm install | |
| cd .. | |
| cd editor | |
| npm install | |
| cd .. | |
| - name: Generate nightly version info | |
| if: ${{ inputs.nightly }} | |
| run: | | |
| cargo xtask update-version --major $VER_MAJOR --minor $VER_MINOR --patch $VER_PATCH -b $GITHUB_RUN_NUMBER | |
| cat version.rc | |
| cat installer/version.wxi | |
| - name: Generate pull_request version info | |
| if: github.event_name == 'pull_request' | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| run: | | |
| cargo xtask update-version --major 0 --minor 0 --patch $PR_NUMBER -b $GITHUB_RUN_NUMBER | |
| cat version.rc | |
| cat installer/version.wxi | |
| - name: Build nightly | |
| if: ${{ inputs.nightly || github.event_name == 'pull_request' }} | |
| env: | |
| # HACK: force embed-resource to use llvm-rc | |
| RC: llvm-rc | |
| run: | | |
| cargo xtask build-installer --nightly --release --target gnullvm | |
| - name: Build release | |
| if: ${{ !inputs.nightly && github.event_name != 'pull_request' }} | |
| env: | |
| # HACK: force embed-resource to use llvm-rc | |
| RC: llvm-rc | |
| run: | | |
| cargo xtask build-installer --release --target gnullvm | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: Installer Artifact With Debuginfo | |
| path: build/installer | |
| - name: Strip debug info | |
| run: | | |
| x86_64-w64-mingw32-strip build/installer/x64/chewing_tip.dll | |
| i686-w64-mingw32-strip build/installer/x86/chewing_tip.dll | |
| x86_64-w64-mingw32-strip build/installer/*.exe | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: Installer Artifact | |
| path: build/installer | |
| package: | |
| runs-on: windows-latest | |
| name: Package | |
| outputs: | |
| unsigned-artifact-id: ${{ steps.upload-unsigned.outputs.artifact-id }} | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Add msbuild to PATH | |
| uses: microsoft/setup-msbuild@v2 | |
| # - name: Start SSH session | |
| # uses: luchihoratiu/debug-via-ssh@main | |
| # with: | |
| # NGROK_AUTH_TOKEN: ${{ secrets.NGROK_TOKEN }} | |
| # SSH_PASS: ${{ secrets.SSH_PASS }} | |
| # NGROK_REGION: jp | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Download Installer Artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: Installer Artifact | |
| path: build/installer | |
| - name: Build Package | |
| shell: cmd | |
| run: | | |
| cargo xtask package-installer | |
| - id: upload-unsigned | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: Unsigned Installer | |
| path: | | |
| dist\windows-chewing-tsf-unsigned.msi |