mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/language-data.git
synced 2026-04-26 10:32:16 +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
The timestamps in the (updated) submodule might be older than on our repo, so force updating in the CI by updating submodule file timestamps.
88 lines
3.3 KiB
YAML
88 lines
3.3 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
if: github.event_name != 'pull_request'
|
|
with:
|
|
token: ${{ secrets.WEBLATE_CI_TOKEN }}
|
|
submodules: true
|
|
persist-credentials: true
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
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@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
|
|
with:
|
|
python-version: '3.14'
|
|
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
|
|
with:
|
|
version: 0.9.25
|
|
- uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
|
|
with:
|
|
path: ~/.cache/pre-commit
|
|
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
|
|
- 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@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.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 }}
|