mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/language-data.git
synced 2026-04-21 09:42:22 +08:00
Some checks are pending
mypy / mypy (push) Waiting to run
Pre-commit check / pre-commit (push) Waiting to run
Distribution / Build packages (push) Waiting to run
Distribution / Publish release to PyPI (push) Blocked by required conditions
Distribution / Create release on GitHub (push) Blocked by required conditions
Languages / lint (push) Waiting to run
Update generated files / submodule-update (push) Waiting to run
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
102 lines
4 KiB
YAML
102 lines
4 KiB
YAML
# 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 }} # zizmor: ignore[secrets-outside-env]
|
|
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@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
|
with:
|
|
version: 0.11.7
|
|
- 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@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
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 sync --all-extras --dev
|
|
- run: |
|
|
source .venv/bin/activate
|
|
# 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@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
|
with:
|
|
branch: create-pull-request/submodule-update
|
|
title: 'chore: update generated files'
|
|
commit-message: 'chore: update generated files'
|
|
token: ${{ secrets.WEBLATE_CI_TOKEN }} # zizmor: ignore[secrets-outside-env]
|
|
- 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 }} # zizmor: ignore[secrets-outside-env]
|
|
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
|