Russian Draft Release #9
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: Russian Draft Release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # ---------------------------------------- | |
| # Setup | |
| # ---------------------------------------- | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: 'sasanarakkha/dpd-db-sbs' | |
| ref: 'sbs-ru' | |
| submodules: 'recursive' | |
| # Fetch depth 0 to allow committing back to the submodule | |
| fetch-depth: 0 | |
| # Use PAT to allow pushing to 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: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.11 | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22.2' | |
| # ---------------------------------------- | |
| # Build Database | |
| # ---------------------------------------- | |
| - name: Config for GitHub release | |
| run: uv run python scripts/rus_exporter/ru_config_github_release.py | |
| - 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_ru_sbs.py | |
| - name: Run initial setup script | |
| run: uv run bash scripts/bash/initial_setup_run_once.sh | |
| - 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 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: 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: 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: 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: 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: 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 | |
| # ---------------------------------------- | |
| # Exporter | |
| # ---------------------------------------- | |
| - 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 | |
| - name: Export Deconstructor | |
| run: uv run python exporter/deconstructor/deconstructor_exporter_ru.py | |
| - name: Export Kindle & ePub | |
| run: uv run python exporter/kindle/kindle_exporter_ru.py | |
| - name: Export Variants | |
| run: uv run exporter/variants/variants_exporter.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 | |
| - name: Tarball DB | |
| run: uv run python scripts/build/tarball_db.py | |
| # ---------------------------------------- | |
| # Prepare Submodules | |
| # ---------------------------------------- | |
| - name: Sync all submodules with Upstream | |
| run: | | |
| for submodule in resources/fdg_dpd resources/tpr_downloads; do | |
| echo "Syncing $submodule..." | |
| cd "$submodule" | |
| if [ "$submodule" = "resources/tpr_downloads" ]; then | |
| branch="master" | |
| else | |
| branch="main" | |
| fi | |
| git fetch origin $branch | |
| git checkout $branch | |
| git reset --hard origin/$branch | |
| cd ../.. | |
| done | |
| # ---------------------------------------- | |
| # Export FDG | |
| # ---------------------------------------- | |
| - name: Run TBW Exporter | |
| run: uv run python exporter/tbw/tbw_exporter_ru.py | |
| # ---------------------------------------- | |
| # Git settings for DPD + RUS | |
| # ---------------------------------------- | |
| - name: Config for DPD + RUS | |
| run: uv run python scripts/rus_exporter/config_github_release_dpd_rus.py | |
| - name: Run TPR Exporter | |
| run: uv run python exporter/tpr/tpr_exporter.py | |
| # ---------------------------------------- | |
| # Update Submodules | |
| # ---------------------------------------- | |
| - name: Update All Submodules | |
| shell: bash | |
| run: | | |
| declare -A submodules=( | |
| ["resources/fdg_dpd"]="fdg https://github.com/o28o/dictPlugin.git" | |
| ["resources/tpr_downloads"]="tpr https://github.com/bksubhuti/tpr_downloads" | |
| ) | |
| for path in "${!submodules[@]}"; do | |
| read name repo <<< "${submodules[$path]}" | |
| echo "Updating $name submodule..." | |
| cd "$path" | |
| echo "Current branch: $(git branch --show-current)" | |
| echo "Git status:" | |
| git status --short | |
| echo "Recent commits:" | |
| git log -1 --oneline | |
| if [ "$path" = "resources/tpr_downloads" ]; then | |
| branch="master" | |
| else | |
| branch="main" | |
| fi | |
| git checkout $branch | |
| git pull origin $branch | |
| echo "=== POST-EXPORT STATUS ===" | |
| git status --short | |
| git add . | |
| echo "=== STAGED CHANGES ===" | |
| git diff --cached --name-only | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| git commit -m "DPD RU: update $(date +'%d-%b-%y')" || echo "No changes to commit" | |
| echo "=== PRE-PUSH STATUS ===" | |
| git log -2 --oneline | |
| git remote -v | |
| echo "=== PUSHING CHANGES ===" | |
| git push origin $branch:$branch | |
| echo "=== PUSH EXIT CODE: $? ===" | |
| cd "$GITHUB_WORKSPACE" | |
| done | |
| # ---------------------------------------- | |
| # Export DPD + RUS and DPD + SBS | |
| # ---------------------------------------- | |
| - name: Export GoldenDict & MDict for DPD + RUS | |
| run: uv run python exporter/goldendict/main.py | |
| - name: Zip GoldenDict & Mdict for DPD + RUS | |
| run: uv run python scripts/rus_exporter/zip_dpd_rus.py | |
| - name: Config for DPD + SBS | |
| run: uv run python scripts/rus_exporter/config_github_release_dpd_sbs.py | |
| - name: Export GoldenDict & MDict for DPD + SBS | |
| run: uv run python exporter/goldendict/main.py | |
| - name: Zip GoldenDict & Mdict for DPD + SBS | |
| run: uv run python scripts/rus_exporter/zip_dpd_sbs.py | |
| # ---------------------------------------- | |
| # Create Draft Release | |
| # ---------------------------------------- | |
| - name: Set Release Date | |
| id: set_release_date | |
| run: echo "RELEASE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
| - name: Set Release Tag | |
| id: set_release_tag | |
| run: echo "RELEASE_TAG=$(uv run python scripts/build/version_print.py)" >> $GITHUB_ENV | |
| - 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.bz2 | |
| 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.bz2 | |
| asset_name: dpd.db.tar.bz2 | |
| asset_content_type: application/zip | |
| - 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 |