Build Dictionary Files #49
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: 'Build' | |
on: | |
# push: | |
# branches: | |
# - main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
CONFIG_URL: https://raw.githubusercontent.com/Nightblade/pob-dict/main | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Fetch Additional Files | |
run: | | |
curl --silent --show-error --parallel --remote-name-all \ | |
${{ env.CONFIG_URL }}/pob-dict.txt \ | |
${{ env.CONFIG_URL }}/poe-dict.txt \ | |
${{ env.CONFIG_URL }}/ignore-dict.txt \ | |
${{ env.CONFIG_URL }}/extra-en-dict.txt | |
- name: Process Files | |
run: | | |
sort -fu src/wiki-ignore-dict.txt pob-dict.txt poe-dict.txt ignore-dict.txt extra-en-dict.txt | awk '{ | |
if ($0 !~ /^$/) { | |
if ($0 !~ /^..*[A-Z]+/) { | |
printf "%c%s\n", toupper(substr($0,1,1)), tolower(substr($0,2)) | |
print tolower($0) | |
} else { | |
print $0 | |
} | |
} | |
}' > persdict.dat | |
cp persdict.dat "Custom Dictionary.txt" | |
rm poe-dict.txt pob-dict.txt ignore-dict.txt extra-en-dict.txt | |
- name: Auto-Commit File | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Auto-Commit File |