Skip to content

chore: Sync with WeblateOrg/meta #1336

chore: Sync with WeblateOrg/meta

chore: Sync with WeblateOrg/meta #1336

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: MIT
name: Update generated files
on:
push:
branches:
- renovate/**
- main
pull_request:
permissions:
contents: write
jobs:
submodule-update:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name != 'pull_request'
with:
token: ${{ secrets.WEBLATE_CI_TOKEN }}
submodules: true
persist-credentials: true
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name == 'pull_request'
with:
submodules: true
persist-credentials: false
- run: sudo apt-get update
- run: sudo apt-get install -y gettext
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
with:
version: 0.10.0
- name: Get cache tag
id: get-date
run: |
echo "cache_tag=$(/bin/date --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
echo "previous_cache_tag=$(/bin/date --date='1 month ago' --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
shell: bash
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
id: pre-commit-cache
with:
path: |
~/.cache/prek
~/.cache/kingfisher
key: ${{ runner.os }}-prek-${{ steps.get-date.outputs.cache_tag }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-prek-${{ steps.get-date.outputs.cache_tag }}
${{ runner.os }}-prek-${{ steps.get-date.outputs.previous_cache_tag }}
${{ runner.os }}-prek-
- name: Install dependencies
run: uv pip install --system -e .[dev]
- run: |
# Touch all the files to make sure timestamps are more recent
touch modules/cldr-json/cldr-json/cldr-localenames-full/main/en/languages.json
touch modules/gettext/gettext-tools/src/plural-table.c
touch modules/qttools/src/linguist/shared/numerus.cpp
touch modules/cldr-json/cldr-json/cldr-core/scriptMetadata.json
touch modules/cldr-json/cldr-json/cldr-misc-full/main/*/layout.json
touch modules/cldr-json/cldr-json/cldr-core/supplemental/plurals.json
touch modules/iso-codes/data/iso_*.json
touch modules/cldr-json/cldr-json/cldr-core/supplemental/territoryInfo.json
touch modules/iso-codes/iso_*/*.po
# Trigger update
make
- run: git diff
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
if: github.event_name == 'pull_request' && github.actor != 'renovate[bot]'
with:
msg: 'chore: update generated files'
- name: Update current branch
if: github.event_name == 'push' && github.ref_name != 'main'
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
with:
commit_message: 'chore: update generated files'
- name: Create Pull Request
id: cpr
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.ref_name == 'main'
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
branch: create-pull-request/submodule-update
title: 'chore: update generated files'
commit-message: 'chore: update generated files'
token: ${{ secrets.WEBLATE_CI_TOKEN }}
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation && steps.cpr.outputs.pull-request-operation != 'none'
run: gh pr merge --rebase --auto "$PR_NUMBER"
env:
GH_TOKEN: ${{ secrets.WEBLATE_CI_TOKEN }}
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}