ci: update locales weekly, not for every commit (#2403)
This commit is contained in:
parent
719d7cff36
commit
cced09f1ac
|
@ -83,3 +83,28 @@ jobs:
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: make test
|
run: make test
|
||||||
working-directory: legacy
|
working-directory: legacy
|
||||||
|
|
||||||
|
locale:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
DEBIAN_FRONTEND=noninteractive sudo apt-get update
|
||||||
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y gettext
|
||||||
|
|
||||||
|
- name: Update locales
|
||||||
|
run: |
|
||||||
|
make -C legacy/locale update
|
||||||
|
|
||||||
|
git config --global user.name "libretime-bot"
|
||||||
|
git config --global user.email "libretime-bot@users.noreply.github.com"
|
||||||
|
|
||||||
|
git add legacy/locale
|
||||||
|
git diff-index --quiet HEAD -- legacy/locale || {
|
||||||
|
git commit --message "chore(legacy): update locales"
|
||||||
|
git push
|
||||||
|
}
|
||||||
|
|
|
@ -16,11 +16,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get update
|
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y gettext
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
|
|
|
@ -104,12 +104,3 @@ repos:
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
language: script
|
language: script
|
||||||
files: ^legacy
|
files: ^legacy
|
||||||
|
|
||||||
- id: legacy-locale-update
|
|
||||||
name: legacy-locale-update
|
|
||||||
description: Update legacy locale
|
|
||||||
entry: make
|
|
||||||
args: [-C, legacy/locale, check-update]
|
|
||||||
pass_filenames: false
|
|
||||||
language: system
|
|
||||||
files: ^legacy
|
|
||||||
|
|
|
@ -32,15 +32,6 @@ update:
|
||||||
find ./locale -name $(PO_FILE) -exec msgmerge $(MSGMERGE_ARGS) "{}" $(PO_FILE) \;
|
find ./locale -name $(PO_FILE) -exec msgmerge $(MSGMERGE_ARGS) "{}" $(PO_FILE) \;
|
||||||
rm $(PO_FILE)
|
rm $(PO_FILE)
|
||||||
|
|
||||||
update-foreach-commit:
|
|
||||||
git rebase main -x "$(MAKE) -C legacy/locale update"
|
|
||||||
|
|
||||||
check-update: update
|
|
||||||
if git status --porcelain -- */LC_MESSAGES/$(PO_FILE) | grep -q '^ M'; then \
|
|
||||||
git --no-pager diff -- */LC_MESSAGES/$(PO_FILE); \
|
|
||||||
exit 1; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
%.mo: %.po
|
%.mo: %.po
|
||||||
msgfmt $< -o $@
|
msgfmt $< -o $@
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue