fix: comment offset for min width #220
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: Commit CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| - dev | |
| tags: | |
| - 'v*' | |
| jobs: | |
| prepare-autohotkey-binaries: | |
| name: Prepare AutoHotkey Binaries | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Dependencies | |
| uses: MinoruSekine/setup-scoop@v4.0.1 | |
| with: | |
| buckets: extras | |
| apps: rcedit autohotkey imagemagick-lean | |
| - name: Prepare binaries | |
| run: | | |
| Push-Location assets | |
| # https://learn.microsoft.com/windows/apps/design/style/iconography/app-icon-construction | |
| magick.exe -background transparent -define 'icon:auto-resize=16,24,32,48,256' zhuyin-t.svg rabbit.ico | |
| magick.exe -background transparent -define 'icon:auto-resize=16,24,32,48,256' zhuyin-t-alt.svg rabbit-alt.ico | |
| magick.exe -background transparent -define 'icon:auto-resize=16,24,32,48,256' pinyin-t.svg rabbit-ascii.ico | |
| Copy-Item "$(scoop prefix autohotkey)/v2/AutoHotkey32.exe","$(scoop prefix autohotkey)/v2/AutoHotkey64.exe" . | |
| rcedit.exe AutoHotkey32.exe --set-icon rabbit.ico | |
| rcedit.exe AutoHotkey64.exe --set-icon rabbit.ico | |
| Pop-Location | |
| Move-Item "assets/AutoHotkey32.exe","assets/AutoHotkey64.exe","assets/rabbit.ico","assets/rabbit-alt.ico","assets/rabbit-ascii.ico" . | |
| - name: Upload Icon | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Icon | |
| path: | | |
| rabbit.ico | |
| rabbit-alt.ico | |
| rabbit-ascii.ico | |
| - name: Upload AutoHotkey | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AutoHotkey | |
| path: | | |
| AutoHotkey32.exe | |
| AutoHotkey64.exe | |
| prepare-dependency: | |
| name: Prepare Dependency | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Fetch Librime | |
| run: | | |
| WORK=`pwd` | |
| LIBRIME_TAG=$(curl -s https://api.github.com/repos/rime/librime/releases/latest | jq -r '.tag_name') | |
| LIBRIME_SHA=$(curl -s https://api.github.com/repos/rime/librime/tags | jq -r --arg LIBRIME_TAG "${LIBRIME_TAG}" '.[] | select(.name == $LIBRIME_TAG).commit.sha' | cut -c1-7) | |
| LIBRIME_MSVC_X86_URL="https://github.com/rime/librime/releases/download/${LIBRIME_TAG}/rime-${LIBRIME_SHA}-Windows-msvc-x86.7z" | |
| LIBRIME_MSVC_X86_DEPS_URL="https://github.com/rime/librime/releases/download/${LIBRIME_TAG}/rime-deps-${LIBRIME_SHA}-Windows-msvc-x86.7z" | |
| LIBRIME_MSVC_X64_URL="https://github.com/rime/librime/releases/download/${LIBRIME_TAG}/rime-${LIBRIME_SHA}-Windows-msvc-x64.7z" | |
| mkdir -p ${WORK}/librime-msvc ${WORK}/librime-clang | |
| cd ${WORK}/librime-msvc && \ | |
| wget -O librime.7z ${LIBRIME_MSVC_X86_URL} && \ | |
| 7z x '-i!dist/lib/rime.dll' librime.7z && \ | |
| cp dist/lib/rime.dll ${WORK}/rime-x86.dll && \ | |
| rm -rf librime.7z dist && \ | |
| wget -O deps.7z ${LIBRIME_MSVC_X86_DEPS_URL} && \ | |
| 7z x '-i!share/opencc' deps.7z && \ | |
| cp -r share/opencc ${WORK}/ && \ | |
| rm -rf deps.7z share | |
| cd ${WORK}/librime-clang && \ | |
| wget -O librime.7z ${LIBRIME_MSVC_X64_URL} && \ | |
| 7z x '-i!dist/lib/rime.dll' librime.7z && \ | |
| cp dist/lib/rime.dll ${WORK}/rime-x64.dll && \ | |
| rm -rf librime.7z dist | |
| - name: Upload Rime | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Rime | |
| path: | | |
| rime-x86.dll | |
| rime-x64.dll | |
| - name: Prepare Data | |
| run: | | |
| WORK=`pwd` | |
| SCHEMAS=${WORK}/schemas | |
| plum_dir=${WORK}/plum | |
| rime_dir=${WORK}/Data | |
| rm -rf ${rime_dir} && mkdir -p ${rime_dir} | |
| rime_dir=${rime_dir} bash plum/rime-install | |
| cp ${SCHEMAS}/rabbit.yaml ${rime_dir}/ | |
| cp -r ${WORK}/opencc ${rime_dir}/ | |
| - name: Upload Data | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Data | |
| path: Data | |
| build-rabbit: | |
| strategy: | |
| matrix: | |
| target: [ x86, x64 ] | |
| include: | |
| - { target: x86, ahk: AutoHotkey32.exe, rime: rime-x86.dll } | |
| - { target: x64, ahk: AutoHotkey64.exe, rime: rime-x64.dll } | |
| name: Build for ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| needs: [ prepare-dependency, prepare-autohotkey-binaries ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Download Dependencies | |
| uses: actions/download-artifact@v4 | |
| - name: Copy Artifacts and Apply Patches | |
| run: | | |
| git apply --stat ./Lib/GetCaretPosEx/GetCaretPosEx.patch | |
| git apply --check ./Lib/GetCaretPosEx/GetCaretPosEx.patch | |
| git apply ./Lib/GetCaretPosEx/GetCaretPosEx.patch | |
| cp AutoHotkey/${{ matrix.ahk }} Rabbit.exe | |
| cp Rime/${{ matrix.rime }} ./Lib/librime-ahk/rime.dll | |
| cp Icon/* Lib/ | |
| cp plum/rime-install.bat . | |
| - name: Set Version | |
| run: | | |
| if [[ ${{ github.ref_name }} == v* ]]; then | |
| VER=${{ github.ref_name }} | |
| VER=${VER:1} | |
| else | |
| VER=${{ github.ref_name }}-$(git rev-parse --short ${{ github.sha }}) | |
| fi | |
| echo $VER | |
| sed -i -E 's/global RABBIT_VERSION := .+/global RABBIT_VERSION := \"'"$VER"'\"/' Lib/RabbitCommon.ahk | |
| - name: Upload Rabbit ${{ matrix.target }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Rabbit-${{ matrix.target }} | |
| path: | | |
| Lib/Direct2D/Direct2D.ahk | |
| Lib/Direct2D/LICENSE | |
| Lib/librime-ahk/*.ahk | |
| Lib/librime-ahk/rime.dll | |
| Lib/librime-ahk/utils | |
| Lib/librime-ahk/LICENSE | |
| Lib/GetCaretPosEx/*.ahk | |
| Lib/GetCaretPosEx/LICENSE.txt | |
| Lib/*.ahk | |
| Lib/*.ico | |
| Rabbit.exe | |
| *.ahk | |
| LICENSE | |
| README.md | |
| rime-install.bat | |
| - name: Upload Full Zip of Rabbit ${{ matrix.target }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Rabbit-Full-${{ matrix.target }} | |
| path: | | |
| Data | |
| Lib/Direct2D/Direct2D.ahk | |
| Lib/Direct2D/LICENSE | |
| Lib/librime-ahk/*.ahk | |
| Lib/librime-ahk/rime.dll | |
| Lib/librime-ahk/utils | |
| Lib/librime-ahk/LICENSE | |
| Lib/GetCaretPosEx/*.ahk | |
| Lib/GetCaretPosEx/LICENSE.txt | |
| Lib/*.ahk | |
| Lib/*.ico | |
| Rabbit.exe | |
| *.ahk | |
| LICENSE | |
| README.md | |
| rime-install.bat | |
| create-nightly: | |
| name: Create Nightly release | |
| if: ${{ github.ref == 'refs/heads/master' }} | |
| runs-on: ubuntu-latest | |
| needs: build-rabbit | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download x64 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Rabbit-Full-x64 | |
| path: x64 | |
| - name: Pack x64 | |
| working-directory: x64 | |
| run: | | |
| mkdir Rime && zip -r -q ../rabbit-nightly-x64.zip * | |
| - name: Download x86 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Rabbit-Full-x86 | |
| path: x86 | |
| - name: Pack x86 | |
| working-directory: x86 | |
| run: | | |
| mkdir Rime && zip -r -q ../rabbit-nightly-x86.zip * | |
| - name: Upload Nightly | |
| uses: marvinpinto/action-automatic-releases@latest | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| automatic_release_tag: latest | |
| prerelease: true | |
| title: "Nightly" | |
| files: | | |
| rabbit-nightly-x64.zip | |
| rabbit-nightly-x86.zip | |
| create-release: | |
| name: Create Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| needs: build-rabbit | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| upload-release: | |
| strategy: | |
| matrix: | |
| target: [ x86, x64 ] | |
| name: Upload Release for ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| needs: create-release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Rabbit-Full-${{ matrix.target }} | |
| path: release | |
| - name: Pack Zip | |
| working-directory: release | |
| run: | | |
| mkdir Rime && zip -r -q ../rabbit-${{ github.ref_name }}-${{ matrix.target }}.zip * | |
| - name: Upload Assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: true | |
| files: | | |
| rabbit-${{ github.ref_name }}-${{ matrix.target }}.zip |