Skip to content

Update dictionaries #1220

Update dictionaries

Update dictionaries #1220

Workflow file for this run

name: Update dictionaries
on:
schedule:
# At 00:00 (UTC) every day
- cron: '0 0 * * *'
# Allow to call the workflow manually
workflow_dispatch:
jobs:
dicthtml:
runs-on: ubuntu-latest
# List of locales to generate
# Sorted by the number of words
strategy:
matrix:
locale:
- fr
- en
- es
- pt
- sv
- ca
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2.2.1
with:
python-version: 3.9
- name: Install LaTeX requirements
run: |
sudo apt update
sudo apt install dvipng texlive-latex-extra
- name: Install requirements
run: python -m pip install -r requirements.txt
- name: Download the latest Wiktionary dump
run: python -Wd -m wikidict ${{ matrix.locale }} --download
- name: Parse the dump
run: python -Wd -m wikidict ${{ matrix.locale }} --parse
- name: Render templates
run: python -Wd -m wikidict ${{ matrix.locale }} --render
- name: Convert to dictionaries (DictFile and Kobo)
run: python -Wd -m wikidict ${{ matrix.locale }} --convert
- name: Generate dictionary (StarDict)
run: |
pyglossary --no-progress-bar --no-color data/${{ matrix.locale }}/dict-${{ matrix.locale }}.df dict-data.ifo
zip -r dict-${{ matrix.locale }}.zip dict-data.* res
- name: Upload the dictionary (DictFile)
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.TOKEN }}
file: data/${{ matrix.locale }}/dict-${{ matrix.locale }}.df
asset_name: dict-${{ matrix.locale }}.df
tag: ${{ matrix.locale }}
overwrite: true
- name: Upload the dictionary (Kobo)
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.TOKEN }}
file: data/${{ matrix.locale }}/dicthtml-${{ matrix.locale }}.zip
asset_name: dicthtml-${{ matrix.locale }}.zip
tag: ${{ matrix.locale }}
overwrite: true
- name: Upload the dictionary (StarDict)
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.TOKEN }}
file: dict-${{ matrix.locale }}.zip
asset_name: dict-${{ matrix.locale }}.zip
tag: ${{ matrix.locale }}
overwrite: true
- name: Update the release description
run: python -Wd -m wikidict ${{ matrix.locale }} --update-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}