Adds filter parameters to allow selective dictionary building #306
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: Release sample dictionaries | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- .gitignore | |
- '*.md' | |
- LICENSE | |
- bin/create_inflections.py | |
env: | |
INPUT_DIR: ./dict | |
OUTPUT_DIR: ./output | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
if: "!contains(github.event.head_commit.message, 'AUTO')" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
submodules: 'recursive' | |
- name: Generates reports on dictionary files | |
run: | | |
python bin/gen_summary.py $INPUT_DIR | |
- name: Setup Ubuntu packages | |
run: | | |
# Call a script so that it can be used in a shell/container as well | |
./bin/install_linux_packages.sh | |
- name: Setup Wine32 | |
run: | | |
# Call a script so that it can be used in a shell/container as well | |
./bin/install_wine32.sh | |
- name: Setup Utilities | |
run: | | |
# Call a script so that it can be used in a shell/container as well | |
./bin/install_utilities.sh | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Setup Python packages | |
run: | | |
pip install -r ./requirements.txt | |
- name: Build all dictionaries | |
run: | | |
python ./bin/convert_all.py --input_folder=$INPUT_DIR --output_folder=$OUTPUT_DIR --extension=tab --filter=CCCE,ThienChuu | |
- name: Zip all artifacts for release | |
run: | | |
zip -9 -j $OUTPUT_DIR/all-stardict.zip $OUTPUT_DIR/stardict/*.* && | |
zip -9 -j $OUTPUT_DIR/all-epub.zip $OUTPUT_DIR/epub/*.* && | |
zip -9 -j $OUTPUT_DIR/all-kobo.zip $OUTPUT_DIR/kobo/*.* && | |
zip -9 -j $OUTPUT_DIR/all-lingvo.zip $OUTPUT_DIR/lingvo/*.* && | |
zip -9 -j $OUTPUT_DIR/all-kindle.zip $OUTPUT_DIR/kindle/*.* && | |
zip -9 -j $OUTPUT_DIR/all-dictd.zip $OUTPUT_DIR/dictd/*.* && | |
zip -9 -j $OUTPUT_DIR/all-yomitan.zip $OUTPUT_DIR/yomitan/*.* && | |
ls -R -l $OUTPUT_DIR | |
- name: Create a new release draft | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "./dict/dict_summary.md,./output/*.zip,./output/kindle/*.mobi,./output/kobo/*.zip,./output/lingvo/*.dz,./output/epub/*.epub,./output/yomitan/*.zip" | |
body: If you can read this, we have forgotten to fill in the changelog. Sorry! | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
draft: true | |
name: Release ${{ github.ref }} |