Main #4722
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: Main | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */1 * * *' | |
env: | |
SUDACHI_DICT_REPO: https://github.com/WorksApplications/SudachiDict | |
SUDACHI_SYNONYMS_DIR: src/main/text/synonyms.txt | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Checkout Synonyms | |
id: synonyms | |
run: | | |
git clone --filter=blob:none --no-checkout $SUDACHI_DICT_REPO ./dict | |
cd dict | |
git sparse-checkout init | |
git sparse-checkout add $SUDACHI_SYNONYMS_DIR | |
git checkout | |
hash=$(git log -1 --pretty=format:"%h" $SUDACHI_SYNONYMS_DIR) | |
echo "::set-output name=hash::$hash" | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Run Script | |
run: | | |
python ssyn2es.py ./dict/$SUDACHI_SYNONYMS_DIR > synonyms.txt | |
- name: Commit And Push | |
uses: EndBug/add-and-commit@v7 | |
with: | |
branch: main | |
add: synonyms.txt | |
message: 'Update synonyms, see: ${{ env.SUDACHI_DICT_REPO }}/blob/${{ steps.synonyms.outputs.hash }}/${{ env.SUDACHI_SYNONYMS_DIR }}' |