-
-
Notifications
You must be signed in to change notification settings - Fork 24
174 lines (160 loc) · 5.21 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
on: [push]
jobs:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up mira
run: |
wget https://github.com/rimeinn/mira/releases/download/latest/mira
chmod +x mira
- name: Test
run: |
./mira -C mira-cache tests/moran.test.yaml
simplified-moran:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cd tools && python3 -m pip install pdm && pdm install
- run: sudo apt install opencc p7zip-full
- run: pdm use -f tools/.venv && $(pdm venv activate) && ./make_simp_dist.sh github
- uses: actions/upload-artifact@v4
with:
name: "Simp-FullPack"
path: dist/**
- uses: actions/upload-artifact@v4
with:
name: "Simp-DictsOnly"
path: |
dist/moran.base.dict.yaml
dist/moran.tencent.dict.yaml
dist/moran.moe.dict.yaml
dist/moran.computer.dict.yaml
dist/moran.hanyu.dict.yaml
dist/moran.words.dict.yaml
- name: Deploy to branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
publish_branch: simp
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
traditional-moran:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
git archive HEAD -o archive.tar
mkdir -p dist
tar xf archive.tar -C dist
rm -rf dist/tools dist/.git dist/.github dist/make_simp_dist.sh dist/tests
- uses: actions/upload-artifact@v4
with:
name: "Trad-FullPack"
path: dist/**
- uses: actions/upload-artifact@v4
with:
name: "Trad-DictsOnly"
path: |
dist/moran.base.dict.yaml
dist/moran.tencent.dict.yaml
dist/moran.moe.dict.yaml
dist/moran.computer.dict.yaml
dist/moran.hanyu.dict.yaml
dist/moran.words.dict.yaml
- name: Deploy to branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
publish_branch: trad
demo-simp:
runs-on: ubuntu-24.04
needs: [simplified-moran]
steps:
- uses: actions/download-artifact@v4
with:
name: Simp-FullPack
- name: Build
run: |
sudo apt install -y librime-data librime-bin
rm -f *.gram
cat >moran.extended.dict.yaml <<EOF
---
name: moran.extended
version: "mini"
sort: by_weight
use_preset_vocabulary: false
import_tables: [moran.chars, moran.base, moran.words]
...
EOF
rime_deployer --build . /usr/share/rime-data ./build
rm -rf ./*.yaml
- uses: actions/upload-artifact@v4
with:
name: Simp-Demo
path: |
build/
lua/
opencc/
demo-trad:
runs-on: ubuntu-24.04
needs: [traditional-moran]
steps:
- uses: actions/download-artifact@v4
with:
name: Trad-FullPack
- name: Build
run: |
sudo apt install -y librime-data librime-bin
rm -f *.gram
cat >moran.extended.dict.yaml <<EOF
---
name: moran.extended
version: "mini"
sort: by_weight
use_preset_vocabulary: false
import_tables: [moran.chars, moran.base, moran.words]
...
EOF
rime_deployer --build . /usr/share/rime-data ./build
rm -rf ./*.yaml
- uses: actions/upload-artifact@v4
with:
name: Trad-Demo
path: |
build/
lua/
opencc/
# upload-to-hamster:
# needs: [simplified-moran, traditional-moran]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Download Simplified Moran Artifact
# uses: actions/download-artifact@v3
# with:
# name: "简体完整配置包"
# path: simplified_artifact
# - name: Archive Simplified Moran Artifact
# run: ( cd simplified_artifact/ && zip -r ../simplified_artifact.zip . )
# - name: Download Traditional Moran Artifact
# uses: actions/download-artifact@v3
# with:
# name: "繁體完整配置包"
# path: traditional_artifact
# - name: Archive Traditional Moran Artifact
# run: ( cd traditional_artifact/ && zip -r ../traditional_artifact.zip . )
# - name: Upload artifacts to Hamster
# env:
# HTTP_AUTHORIZATION: ${{ secrets.HTTP_AUTHORIZATION }}
# HTTP_HAMSTER_USERID: ${{ secrets.HTTP_HAMSTER_USERID }}
# run: |
# pip3 install -r tools/requirements.txt
# # 魔然【简】
# python3 tools/hamsterUpload.py 0AD56D4E-010E-4961-B6AB-4FFDEA4AA5BF simplified_artifact.zip --variant 简体
# # 魔然【繁】
# python3 tools/hamsterUpload.py D5C8710C-DF74-4004-B5C6-742344BCDC69 traditional_artifact.zip --variant 繁體