forked from digitalpalidictionary/dpd-db
-
Notifications
You must be signed in to change notification settings - Fork 2
523 lines (410 loc) · 17.9 KB
/
Copy pathru_release_test.yml
File metadata and controls
523 lines (410 loc) · 17.9 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
name: Test Russian Draft Release
on:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
runs-on: ubuntu-latest
outputs:
RELEASE_DATE: ${{ steps.set_release_date.outputs.RELEASE_DATE }}
RELEASE_TAG: ${{ steps.set_release_tag.outputs.RELEASE_TAG }}
steps:
# ----------------------------------------
# Setup
# ----------------------------------------
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
# keep the default swap file: the goldendict high-mem exporter needs
# it on 16GB runners (upstream draft_release keeps swap too)
swap-storage: false
- name: Checkout repository
uses: actions/checkout@v5
with:
repository: 'sasanarakkha/dpd-db-sbs'
ref: 'sbs-ru'
submodules: 'recursive'
# Fetch depth 1 for shallow clone to save disk space
fetch-depth: 1
# Use PAT to allow pushing to the submodule
token: ${{ secrets.GH_PAT }}
- name: Remove large dirs
run: |
rm -rf ${{ github.workspace }}/resources/bjt/dev/*
rm -rf ${{ github.workspace }}/resources/sc-data/html_text/*
- name: Unzip deconstructor_output
run: |
cd ${{ github.workspace }}/resources/deconstructor_output
tar -xzvf deconstructor_output.json.tar.gz
ls -la
cd ${{ github.workspace }}/
- name: Install dictzip
run: sudo apt-get update && sudo apt-get install -y dictzip
- name: Install Slob Linux dependencies
run: sudo apt-get install -y build-essential libicu-dev icu-devtools pkg-config
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dependencies
run: uv sync --all-groups
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.22.2'
# ----------------------------------------
# Build Database
# ----------------------------------------
- name: Config for GitHub release
run: uv run python scripts/rus_exporter/set_config.py --profile release_full_ru
- name: Create dpd.db
run: touch dpd.db
- name: Build the database
run: uv run python scripts/build/db_rebuild_from_tsv.py
# - name: Apply Additions
# run: uv run python scripts/change_in_db/apply_all_additions.py
- name: Populating RU SBS tables
run: uv run python scripts/build/db_rebuild_from_tsv_dps.py
- name: Run initial setup script
run: uv run python scripts/bash/initial_setup_run_once.py
- name: Create version
run: uv run python tools/version_ru.py
- name: Create Inflection Templates
run: uv run python db/inflections/create_inflection_templates.py
- name: Create Inflection Tables
run: uv run python db/inflections/generate_inflection_tables.py
- name: Update Root Has Verb values
run: uv run python scripts/build/root_has_verb_updater.py
- name: Update Sanskrit Family Roots
run: uv run python scripts/build/sanskrit_root_families_updater.py
- name: Add Root Families
run: uv run python db/families/family_root.py
- name: Add Word Families
run: uv run python db/families/family_word.py
- name: Add Compound Families
run: uv run python db/families/family_compound.py
- name: Add Sets
run: uv run python db/families/family_set.py
- name: Add Idioms
run: uv run python db/families/family_idiom.py
- name: Add Root Families Ru
run: uv run python db/families/family_root_ru.py
- name: Add Word Families Ru
run: uv run db/families/family_word_ru.py
- name: Add Compound Families Ru
run: uv run python db/families/family_compound_ru.py
- name: Add Sets Ru
run: uv run python db/families/family_set_ru.py
- name: Add Idioms Ru
run: uv run python db/families/family_idiom_ru.py
- name: Families to JSON
run: uv run python scripts/build/families_to_json.py
- name: Families to JSON RUS
run: uv run python scripts/build/families_to_json_ru.py
- name: Extract Variants
run: uv run python db/variants/main.py
- name: Run Deconstructor
run: uv run python scripts/build/deconstructor_output_add_to_db.py
- name: Add api ca eva iti to inflections
run: uv run python scripts/build/api_ca_eva_iti_iva_hi.py
- name: Transliterate Inflections
run: uv run python db/inflections/transliterate_inflections.py
- name: Inflections to Headwords
run: uv run python db/inflections/inflections_to_headwords.py
- name: Populate Sutta table
run: uv run python db/suttas/suttas_update.py
- name: Add Suttas to Lookup table
run: uv run python db/suttas/suttas_to_lookup.py
- name: Generate Grammar data
run: uv run python db/grammar/grammar_to_lookup.py
- name: Lookup Variants and Spelling Mistakes
run: uv run python db/lookup/spelling_mistakes.py
- name: Lookup Transliterate
run: uv run python db/lookup/transliterate_lookup_table.py
- name: Lookup Help and Abbreviations
run: uv run python db/lookup/help_abbrev_add_to_lookup.py
- name: Lookup Help and Abbreviations Ru
run: uv run python db/lookup/help_abbrev_add_to_lookup_ru.py
- name: Add Frequency
run: |
go build -o frequency go_modules/frequency/main.go
./frequency
- name: Run EBT Counter
run: uv run python scripts/build/ebt_counter.py
- name: Update Bold Definitions
run: uv run python db/bold_definitions/update_bold_definitions_db.py
- name: Add EPD to Lookup Table
run: uv run python db/epd/epd_to_lookup.py
- name: Add RPD to Lookup Table
run: uv run python db/rpd/rpd_to_lookup.py
- name: Add TPD to Lookup Table
run: uv run python db/tpd/tpd_to_lookup.py
- name: Test Dealbreakers
run: uv run python scripts/build/dealbreakers.py
# - name: Apply Corrections
# run: uv run python scripts/change_in_db/apply_all_corrections.py
# ----------------------------------------
# Download Audio Database
# ----------------------------------------
- name: Download Audio Index
run: uv run python audio/index_release_download.py
# ----------------------------------------
# Exporter
# ----------------------------------------
- name: Setup disk space checker
run: |
cat << 'EOF' >> $HOME/check_disk.sh
#!/bin/bash
echo "=== Disk space and large files (>1GB) ==="
df -h
du -h --max-depth=2 ${{ github.workspace }} | grep -E "^[0-9.]+[GT]" || echo "No files >1GB found"
EOF
chmod +x $HOME/check_disk.sh
- name: Export Grammar Dictionary
run: uv run python exporter/grammar_dict/grammar_dict_ru.py
- name: Export GoldenDict & MDict
run: |
uv run python exporter/goldendict/main_ru.py
echo "=== After GoldenDict export ==="
$HOME/check_disk.sh
- name: Export Deconstructor
run: |
uv run python exporter/deconstructor/deconstructor_exporter_ru.py
echo "=== After Deconstructor export ==="
$HOME/check_disk.sh
- name: Export Kindle & ePub
run: |
uv run python exporter/kindle/kindle_exporter_ru.py
echo "=== After Kindle export ==="
$HOME/check_disk.sh
- name: Cleanup Kindle Intermediate Files
run: rm -rf exporter/kindle/ru_components/epub/
- name: Export Variants
run: |
uv run exporter/variants/variants_exporter.py
echo "=== After Variants export ==="
$HOME/check_disk.sh
- name: Export SuttaCentral Ru
run: uv run python exporter/sutta_central/sutta_central_exporter_ru.py
- name: Check disk space and memory
run: |
free -h # Check available memory
df -h # Check disk space
- name: Zip GoldenDict & Mdict
run: |
uv run python scripts/rus_exporter/ru_zip_goldendict_mdict.py
echo "=== After zipping ==="
$HOME/check_disk.sh
- name: Cleanup GoldenDict & MDict Intermediate Files
run: |
rm -rf exporter/share/ru-dpd/
rm -rf exporter/share/ru-dpd-grammar/
rm -rf exporter/share/ru-dpd-deconstructor/
rm -rf exporter/share/dpd-variants/
rm -f exporter/share/*.mdx
rm -f exporter/share/*.mdd
- name: Tarball DB
run: |
uv run python scripts/build/tarball_db.py
echo "=== After tarball ==="
$HOME/check_disk.sh
# ----------------------------------------
# Git settings for DPD + RUS
# ----------------------------------------
- name: Config for DPD + RUS
run: uv run python scripts/rus_exporter/set_config.py --profile release_rus
- name: Run TPR Exporter
run: uv run python exporter/tpr/tpr_exporter_ru.py
# ----------------------------------------
# Export DPD + RUS and DPD + SBS and DPD + TA
# ----------------------------------------
- name: Export GoldenDict & MDict for DPD + RUS
run: |
uv run python exporter/goldendict/main.py
echo "=== After GoldenDict for DPD + RUS export ==="
$HOME/check_disk.sh
- name: Zip GoldenDict & Mdict for DPD + RUS
run: uv run python scripts/rus_exporter/zip_dpd.py --locale rus
- name: Cleanup DPD + RUS Intermediate Files
run: |
rm -rf exporter/share/dpd/
rm -f exporter/share/*.mdx
rm -f exporter/share/*.mdd
- name: Config for DPD + SBS
run: uv run python scripts/rus_exporter/set_config.py --profile release_sbs
- name: Export GoldenDict & MDict for DPD + SBS
run: |
uv run python exporter/goldendict/main.py
echo "=== After GoldenDict for DPD + SBS export ==="
$HOME/check_disk.sh
- name: Zip GoldenDict & Mdict for DPD + SBS
run: uv run python scripts/rus_exporter/zip_dpd.py --locale sbs
- name: Cleanup DPD + SBS Intermediate Files
run: |
rm -rf exporter/share/dpd/
rm -f exporter/share/*.mdx
rm -f exporter/share/*.mdd
- name: Config for DPD + TA
run: uv run python scripts/rus_exporter/set_config.py --profile release_ta
- name: Export GoldenDict & MDict for DPD + TA
run: |
uv run python exporter/goldendict/main_sbs.py
echo "=== After GoldenDict for DPD + TA export ==="
$HOME/check_disk.sh
- name: Zip GoldenDict & Mdict for DPD + TA
run: uv run python scripts/rus_exporter/zip_dpd.py --locale ta
# ----------------------------------------
# Create Draft Release
# ----------------------------------------
- name: Set Release Date
id: set_release_date
run: |
echo "RELEASE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
echo "RELEASE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Set Release Tag
id: set_release_tag
run: |
echo "RELEASE_TAG=$(uv run python scripts/build/version_print.py)" >> $GITHUB_ENV
echo "RELEASE_TAG=$(uv run python scripts/build/version_print.py)" >> $GITHUB_OUTPUT
- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: ${{ env.RELEASE_DATE }}
body: |
### [Цифровой Словарь Пали](https://devamitta.github.io/dpd.rus/)
DPD - это богатый возможностями словарь палийского языка на русском, который работает [онлайн](https://ru.dpdict.net) и в GoldenDict, MDict, DictTango и Kindle, или в любом другом приложении, поддерживающем форматы stardict, mdict, epub, mobi.
На этой странице доступа свежая русской версия словаря в разных форматах. Последнюю версию оригинального английского DPD можно найти на [этой GitHub странице](https://github.com/digitalpalidictionary/dpd-db/releases). Там же можно почитать историю изменений и дополнений.
Также доступна совмещенная версия английского DPD с русским переводом. Более подробную информацию можно найти на [этой странице.](https://devamitta.github.io/dpd.rus/dpd_rus.html)
---
Цифровой Словарь Пали распространяется под лицензией [С указанием авторства-Некоммерческая-С сохранением условий версии 4.0 Международная](http://creativecommons.org/licenses/by-nc-sa/4.0/deed.ru)
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a><br />
draft: true
prerelease: false
# ----------------------------------------
# Update Release Assets
# ----------------------------------------
- name: Upload Asset ru-dpd-goldendict.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/ru-dpd-goldendict.zip
asset_name: ru-dpd-goldendict.zip
asset_content_type: application/zip
- name: Upload Asset ru-dpd-mdict.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/ru-dpd-mdict.zip
asset_name: ru-dpd-mdict.zip
asset_content_type: application/zip
- name: Upload Asset ru-dpd-kindle.epub
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/ru-dpd-kindle.epub
asset_name: ru-dpd-kindle.epub
asset_content_type: application/zip
- name: Upload Asset ru-dpd-kindle.mobi
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/ru-dpd-kindle.mobi
asset_name: ru-dpd-kindle.mobi
asset_content_type: application/zip
- name: Upload Asset dpd.db.tar.xz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/dpd.db.tar.xz
asset_name: dpd.db.tar.xz
asset_content_type: application/zip
- name: Upload Asset pli2ru_dpd.json
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: resources/sc-data/dictionaries/simple/ru/pli2ru_dpd.json
asset_name: pli2ru_dpd.json
asset_content_type: application/json
- name: Upload Asset dpd+sbs-goldendict.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/dpd+sbs-goldendict.zip
asset_name: dpd+sbs-goldendict.zip
asset_content_type: application/zip
- name: Upload Asset dpd+sbs-mdict.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/dpd+sbs-mdict.zip
asset_name: dpd+sbs-mdict.zip
asset_content_type: application/zip
- name: Upload Asset dpd+rus-goldendict.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/dpd+rus-goldendict.zip
asset_name: dpd+rus-goldendict.zip
asset_content_type: application/zip
- name: Upload Asset dpd+rus-mdict.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/dpd+rus-mdict.zip
asset_name: dpd+rus-mdict.zip
asset_content_type: application/zip
- name: Upload Asset dpd+ta-goldendict.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/dpd+ta-goldendict.zip
asset_name: dpd+ta-goldendict.zip
asset_content_type: application/zip
- name: Upload Asset dpd+ta-mdict.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: exporter/share/dpd+ta-mdict.zip
asset_name: dpd+ta-mdict.zip
asset_content_type: application/zip