Dictionary #37
This file contains 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: Dictionary | |
on: | |
schedule: | |
- cron: 0 21 6 * * | |
workflow_dispatch: | |
jobs: | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.time.outputs.version }} | |
steps: | |
- name: Decide version | |
env: | |
TZ: "Asia/Tokyo" | |
id: time | |
run: | | |
if [ "$(date +'%d')" -gt 20 ]; then | |
day=20 | |
else | |
day=01 | |
fi | |
echo "version=$(date +'%Y%m')$day" >> "$GITHUB_OUTPUT" | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if ! gh release view -R ${{ github.repository }} ${{ steps.time.outputs.version }}; then | |
gh release create -R ${{ github.repository }} ${{ steps.time.outputs.version }} -d -t ${{ steps.time.outputs.version }} -n 'These XTBook dictionary files (.xtbdict) are automatically built from the version ${{ steps.time.outputs.version }}. **You must extract them with an extractor such as `tar` or [7-Zip](http://www.7-zip.org/) before using them on the XTBook.** For 7-Zip, download all splitted files and specify to extract the first archive. For `tar`, concatenate all splitted files with `tarcat` and pipe them to `tar`. Open an [issue](https://github.com/watamario15/xtbook/issues) for Wikimedia wikis you need that are not currently listed here. License information can be found [here](https://watamario15.github.io/xtbook). | |
Since some dictionaries such as Brain Wiki, English Wikipedia, and images for Japanese Uncyclopedia cannot be automatically built, the repository owner manually builds them and uploads afterwards here. However, it is not guaranteed that I build all these dictionaries every month. If you cannot find a dictionary file you need in the latest release, wait for several days or grab one from an older release. | |
**Other dictionary files** | |
- Images for Japanese Wikipedia: [JAIST](https://jaist.dl.sourceforge.jp/storage/g/x/xt/xtbook/WikipediaImage/20190730/jawikiimg-20190730.xtbdict.7z) / [IIJ](https://iij.dl.sourceforge.jp/storage/g/x/xt/xtbook/WikipediaImage/20190730/jawikiimg-20190730.xtbdict.7z) | |
- Japanese Uncyclopedia: [JAIST](https://jaist.dl.sourceforge.jp/xtbook/72500/jaunwiki-20200306.xtbdict.7z) / [IIJ](https://iij.dl.sourceforge.jp/xtbook/72500/jaunwiki-20200306.xtbdict.7z) or [JAIST](https://jaist.dl.sourceforge.jp/xtbook/70198/jaunwiki-20181018.xtbdict.7z) / [IIJ](https://iij.dl.sourceforge.jp/xtbook/70198/jaunwiki-20181018.xtbdict.7z) | |
--- | |
${{ steps.time.outputs.version }} の版を元に自動生成された XTBook 辞書ファイル (.xtbdict) です。**ダウンロードしたファイルは、最初に `tar` や [7-Zip](https://7-zip.opensource.jp/) 等を用いて展開する必要があります。** 7-Zip なら分割ファイル全てをダウンロードし、最初の番号のファイルを指定して展開します。`tar` の場合は `tarcat` を用いて全てを結合し、それをパイプで `tar` に流して展開します。Wikimedia 財団の wiki のうち、生成していないものについては [issue](https://github.com/watamario15/xtbook/issues) を立ててもらえれば検討します。ライセンス情報は[こちら](https://watamario15.github.io/xtbook)から確認できます。 | |
Uncyclopedia 日本語版の画像データ、Brain Wiki、英語版 Wikipedia は自動化できないため、後日リポジトリオーナーが手動生成してリリースに追加しています。ただし、毎回全ての辞書をビルドするとは限りません。最新リリースに求めている辞書がない場合は、数日待ってもう一度見に来るか、過去のリリースからダウンロードしてください。 | |
**他の辞書ファイル** | |
- 日本語版 Wikipedia 画像: [JAIST](https://jaist.dl.sourceforge.jp/storage/g/x/xt/xtbook/WikipediaImage/20190730/jawikiimg-20190730.xtbdict.7z) / [IIJ](https://iij.dl.sourceforge.jp/storage/g/x/xt/xtbook/WikipediaImage/20190730/jawikiimg-20190730.xtbdict.7z) | |
- 日本語版 Uncyclopedia: [JAIST](https://jaist.dl.sourceforge.jp/xtbook/72500/jaunwiki-20200306.xtbdict.7z) / [IIJ](https://iij.dl.sourceforge.jp/xtbook/72500/jaunwiki-20200306.xtbdict.7z) または [JAIST](https://jaist.dl.sourceforge.jp/xtbook/70198/jaunwiki-20181018.xtbdict.7z) / [IIJ](https://iij.dl.sourceforge.jp/xtbook/70198/jaunwiki-20181018.xtbdict.7z) | |
--- | |
- `jawiki`: Japanese Wikipedia | |
- `jawikibooks`: Japanese Wikibooks | |
- `jawikinews`: Japanese Wikinews | |
- `jawikiquote`: Japanese Wikiquote | |
- `jawikisource`: Japanese Wikisource | |
- `jawiktionary`: Japanese Wiktionary | |
- `enwiki`: English Wikipedia | |
- `enwikibooks`: English Wikibooks | |
- `enwikinews`: English Wikinews | |
- `enwikiquote`: English Wikiquote | |
- `enwikisource`: English Wikisource | |
- `enwiktionary`: English Wiktionary | |
- `simplewiki`: Simple English Wikipedia | |
- `simplewiktionary`: Simple English Wiktionary | |
- `eowiki`: Esperanto Wikipedia | |
- `dewiki`: German Wikipedia | |
- `eswiki`: Spanish Wikipedia | |
- `frwiki`: French Wikipedia | |
- `itwiki`: Italian Wikipedia | |
- `ruwiki`: Russian Wikipedia | |
- `specieswiki`: Wikispecies | |
- `jaunwiki`: Japanese Uncyclopedia | |
- `jabrain`: Brain Wiki' | |
fi | |
dictgen: | |
name: Convert | |
needs: [create_release] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
wiki: # enwiki is too big to build on GitHub Actions | |
- jawiki | |
- jawikibooks | |
- jawikinews | |
- jawikiquote | |
- jawikisource | |
- jawiktionary | |
- enwikibooks | |
- enwikinews | |
- enwikiquote | |
- enwikisource | |
- enwiktionary | |
- simplewiki | |
- simplewiktionary | |
- eowiki | |
- dewiki | |
- eswiki | |
- frwiki | |
- itwiki | |
- ruwiki | |
- specieswiki | |
steps: | |
- name: Convert | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
if ! gh release view -R ${{ github.repository }} ${{ steps.time.outputs.version }} | grep '^\s*asset:\s*${{ matrix.wiki }}-${{ needs.create_release.outputs.version }}.xtbdict.tar'; then | |
curl -sSfLO https://github.com/watamario15/MkXTBWikiplexus/releases/latest/download/linux-amd64.zip | |
unzip -oq linux-amd64.zip -d xtbconv | |
sudo apt install -y mecab-ipadic-utf8 libkakasi2 | |
export PATH=${{ github.workspace }}/xtbconv:$PATH | |
export DICTDIR=${{ github.workspace }} | |
export PLIST=${{ github.workspace }}/xtbconv/info-plists | |
export WIKIMEDIA_MIRROR=${{ vars.WIKIMEDIA_MIRROR }} | |
xtbconv wikimedia ${{ matrix.wiki }} ${{ needs.create_release.outputs.version }} 1900M | |
gh release upload -R ${{ github.repository }} ${{ needs.create_release.outputs.version }} ./*.xtbdict.tar.* --clobber | |
fi | |
publish: | |
name: Publish | |
needs: [create_release, dictgen] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Publish the draft | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release edit -R ${{ github.repository }} ${{ needs.create_release.outputs.version }} --draft=false |