fix: 32 bit broken by string slice #44
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: Continuous Integration | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- dev | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Download Dependencies | |
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_URL="https://github.com/rime/librime/releases/download/${LIBRIME_TAG}/rime-${LIBRIME_SHA}-Windows-msvc.7z" | |
LIBRIME_DEPS_URL="https://github.com/rime/librime/releases/download/${LIBRIME_TAG}/rime-deps-${LIBRIME_SHA}-Windows-msvc.7z" | |
wget -O librime.7z ${LIBRIME_URL} | |
wget -O librime-deps.7z ${LIBRIME_DEPS_URL} | |
7z x '-i!dist/lib/rime.dll' librime.7z | |
cp dist/lib/rime.dll ${WORK}/ | |
7z x '-i!share/opencc' librime-deps.7z | |
AHK_VER=$(curl -s https://www.autohotkey.com/download/2.0/version.txt) | |
AHK_URL="https://www.autohotkey.com/download/2.0/AutoHotkey_${AHK_VER}.zip" | |
wget -O ahk.zip ${AHK_URL} | |
unzip -p ahk.zip AutoHotkey32.exe > Rabbit.exe | |
JIANDAO_TAG=$(curl -s https://api.github.com/repos/amorphobia/rime-jiandao/releases/latest | jq -r '.tag_name') | |
JIANDAO_URL="https://github.com/amorphobia/rime-jiandao/releases/download/${JIANDAO_TAG}/jiandao-${JIANDAO_TAG}.zip" | |
wget -O jiandao.zip ${JIANDAO_URL} | |
rm -rf ${WORK}/schemas/jiandao && mkdir ${WORK}/schemas/jiandao | |
unzip jiandao.zip -d ${WORK}/schemas/jiandao/ | |
- name: Make Icon | |
run: | | |
sudo apt-get install -y imagemagick | |
convert -background transparent -define 'icon:auto-resize=16,24,32,64,128,256' icon.svg Rabbit.ico | |
- name: Prepare SharedSupport | |
run: | | |
WORK=`pwd` | |
SCHEMAS=${WORK}/schemas | |
SHARED=${WORK}/SharedSupport | |
rm -rf ${SHARED} && mkdir -p ${SHARED} | |
cp ${SCHEMAS}/prelude/*.yaml ${SHARED}/ | |
cp ${SCHEMAS}/essay/essay.txt ${SHARED}/ | |
cp ${SCHEMAS}/default.yaml ${SHARED}/ | |
cp ${SCHEMAS}/luna-pinyin/*.yaml ${SHARED}/ | |
cp -r ${SCHEMAS}/jiandao/* ${SHARED}/ | |
cp share/opencc/* ${SHARED}/opencc/ | |
- name: Upload SharedSupport to Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: SharedSupport | |
path: SharedSupport | |
- name: Upload Rabbit to Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Rabbit | |
path: | | |
Lib/librime-ahk/*.ahk | |
Lib/librime-ahk/LICENSE | |
Lib/*.ahk | |
rime.dll | |
Rabbit.exe | |
Rabbit.ico | |
*.ahk | |
LICENSE | |
README.md | |
release: | |
name: Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: release | |
- name: Pack Release Zip | |
working-directory: release | |
run: | | |
cp -r Rabbit/* ./ && rm -rf Rabbit | |
mkdir Rime && zip -r -q ../rabbit-${{ github.ref_name }}.zip * | |
- name: Create Release and Upload Assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: true | |
files: | | |
rabbit-${{ github.ref_name }}.zip |