Skip to content

Commit

Permalink
chore: use submodule for dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
amorphobia committed Aug 17, 2024
1 parent e288ce3 commit 07b47eb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 30 deletions.
40 changes: 10 additions & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Make Dicts
run: |
Expand All @@ -41,29 +43,21 @@ jobs:
make dicts DEWEIGHT=1 VERSION=${{ github.ref_name }}
fi
- name: Install Dependencies
run: sudo apt-get install -y opencc

- name: Fetch Emoji
- name: Build Opencc Dependencies
run: |
sudo apt-get install -y opencc
if command -v opencc &> /dev/null; then
echo "$(opencc --version)"
mkdir -p schema/opencc
rm -rf emoji
git clone --depth 1 https://github.com/rime/rime-emoji emoji
opencc -c t2s.json -i emoji/opencc/emoji_category.txt | awk '!seen[$1]++' > schema/opencc/emoji_category.txt
opencc -c t2s.json -i emoji/opencc/emoji_word.txt | awk '!seen[$1]++' > schema/opencc/emoji_word.txt
opencc -c t2s.json -i deps/rime-emoji/opencc/emoji_category.txt | awk '!seen[$1]++' > schema/opencc/emoji_category.txt
opencc -c t2s.json -i deps/rime-emoji/opencc/emoji_word.txt | awk '!seen[$1]++' > schema/opencc/emoji_word.txt
# https://github.com/rime/rime-emoji/issues/48
sed -i 's/鼔/鼓/g' schema/opencc/emoji_word.txt
cp emoji/opencc/emoji.json schema/opencc/
fi
cp deps/rime-emoji/opencc/emoji.json schema/opencc/
- name: Fetch opencc-tonggui
run: |
TAG=$(curl -s https://api.github.com/repos/amorphobia/opencc-tonggui/releases/latest | jq -r '.tag_name')
URL="https://github.com/amorphobia/opencc-tonggui/releases/download/${TAG}/opencc-tonggui-${TAG}.zip"
wget -O tonggui.zip ${URL}
unzip tonggui.zip -d schema
make -C deps/opencc-tonggui
cp deps/opencc-tonggui/opencc/* schema/opencc/
fi
- name: Make Zip
run: |
Expand Down Expand Up @@ -122,17 +116,3 @@ jobs:
FOLDER: release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MESSAGE: "Release ${{ github.ref_name }}"

# sync-gitee:
# name: Sync to Gitee
# runs-on: ubuntu-latest
# needs: pack-schema
# steps:
# - name: Hub Mirror Action
# uses: Yikun/hub-mirror-action@master
# with:
# src: github/amorphobia
# dst: gitee/amorphobia
# dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
# dst_token: ${{ secrets.GITEE_TOKEN }}
# static_list: "rime-jiandao"
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "deps/rime-emoji"]
path = deps/rime-emoji
url = https://github.com/rime/rime-emoji
[submodule "deps/opencc-tonggui"]
path = deps/opencc-tonggui
url = https://github.com/amorphobia/opencc-tonggui
1 change: 1 addition & 0 deletions deps/opencc-tonggui
Submodule opencc-tonggui added at 1489b9
1 change: 1 addition & 0 deletions deps/rime-emoji
Submodule rime-emoji added at be7d30

0 comments on commit 07b47eb

Please sign in to comment.