update #1016
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: Build | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [update] | |
push: | |
branches: | |
- main | |
paths: | |
- 'automation/pyproject.toml' | |
- 'automation/poetry.lock' | |
- '**.py' | |
- 'config.yaml' | |
- '.github/workflows/build.yml' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'automation/pyproject.toml' | |
- 'automation/poetry.lock' | |
- '**.py' | |
- 'config.yaml' | |
- '.github/workflows/build.yml' | |
permissions: | |
contents: write | |
jobs: | |
process-translations: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: "poetry" | |
cache-dependency-path: automation/poetry.lock | |
- name: Install library and dependencies | |
run: | | |
cd automation | |
poetry install --no-interaction --no-dev | |
- name: Fetch translations | |
run: | | |
git submodule init | |
git submodule update --remote | |
- name: Process po files | |
run: | | |
cd automation | |
poetry run process ../ | |
- name: Generate diagram | |
run: | | |
cd automation | |
poetry run progress_diagram ../translations-backup/translations/dwarf-fortress-steam ../images/dwarf-fortress-steam.svg --width=600 --height=600 | |
poetry run progress_diagram ../translations-backup/translations/dwarf-fortress-steam ../images/dwarf-fortress-steam-short.svg --minimal-percent=1 --width=600 --height=320 | |
- name: Push changes to the repository | |
if: ${{ !contains(fromJSON('["push", "pull_request"]'), github.event_name) }} | |
uses: EndBug/add-and-commit@v9.1.4 | |
with: | |
author_name: github-actions[bot] | |
author_email: 41898282+github-actions[bot]@users.noreply.github.com | |
trigger-update-data: | |
if: ${{ !contains(fromJSON('["push", "pull_request"]'), github.event_name) }} | |
needs: process-translations | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Dispatch dictionary manifest update | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.REPOSITORY_DISPATCH_PAT }} | |
repository: dfint/update-data | |
event-type: dict |