Sunshine/.github/workflows/localize.yml
ReenigneArcher 536df759ae Initial version of sphinx documentation and...
- remove ubuntu 21.04 from CI (end of life)
- adjust matrix strategy for clang.yml
- Use lessons learned from RetroArcher on localize.yml, crowdin.yml, and locale.py
- Add end of life comments to Dockerfiles
- Adjust dependency order in Dockerfiles
2022-04-18 14:53:28 -04:00

75 lines
1.9 KiB
YAML

name: localize
on:
push:
branches: [nightly]
paths: # prevents workflow from running unless these files change
- 'sunshine/**'
- 'locale/sunshine.po'
workflow_dispatch:
jobs:
localize:
name: Update Localization
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python 3.9
uses: actions/setup-python@v3 # https://github.com/actions/setup-python
with:
python-version: '3.9'
- name: Set up Python 3.9 Dependencies
run: |
cd ./scripts
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
- name: Set up xgettext
run: |
sudo apt-get update -y && \
sudo apt-get --reinstall install -y \
gettext
- name: Update Strings
run: |
python ./scripts/_locale.py --extract
- name: git diff
run: |
# print the git diff
git diff --exit-code locale/sunshine.po
# set the variable with minimal output
OUTPUT=$(git diff --exit-code --numstat locale/sunshine.po)
echo "git_diff=${OUTPUT}" >> $GITHUB_ENV
- name: git reset
if: ${{ env.git_diff != '1 1 locale/sunshine.po' }} # only run if more than 1 line changed
run: |
git reset --hard
- name: Create/Update Pull Request
uses: peter-evans/create-pull-request@v4
with:
add-paths: |
locale/*.po
token: ${{ secrets.GH_PAT }} # must trigger PR tests
commit-message: New localization template
branch: localize/update
delete-branch: true
base: nightly
title: New Babel Updates
body: |
Update report
- Updated with *today's* date
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: |
babel
l10n