mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
Previously the Crowdin workflow ran two independent jobs that each opened
their own pull request: the crowdin/github-action sync PR ("New Crowdin
Translations") and the peter-evans seed PR ("Seed translator npub
placeholders").
Collapse them into a single job: the Crowdin action now only downloads
translations into the working tree (push_translations/create_pull_request
disabled), the seed script edits translators.json in the same checkout, and
one create-pull-request step opens a single combined PR on
l10n_crowdin_translations.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kxm4Pq3rm4doVLqJ2LaXtr
74 lines
3.1 KiB
YAML
74 lines
3.1 KiB
YAML
name: Crowdin Action
|
|
|
|
on:
|
|
push:
|
|
# paths: ["app/src/main/res/**/strings.xml"] // removes filter to allow downloads at any moment.
|
|
branches: [ main ]
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
# Single job so the Crowdin translation sync and the translator-placeholder seed
|
|
# land in ONE pull request instead of two. The Crowdin action only downloads into
|
|
# the working tree (push_translations/create_pull_request disabled); the seed
|
|
# script then edits translators.json; finally one create-pull-request step opens a
|
|
# single PR with both sets of changes (and no-ops when there is no diff).
|
|
synchronize-with-crowdin:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
# Need tags so scripts/translators.sh can resolve the last v* release tag
|
|
# for the "since last tag" window.
|
|
fetch-depth: 0
|
|
|
|
- name: crowdin action
|
|
uses: crowdin/github-action@v2
|
|
with:
|
|
upload_sources: true
|
|
upload_translations: true
|
|
download_translations: true
|
|
# Let the downloaded translations stay in the working tree; the single
|
|
# create-pull-request step below opens the combined PR.
|
|
push_translations: false
|
|
create_pull_request: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
|
|
# Keep docs/changelog/translators.json seeded with everyone who has translated
|
|
# recently, so the per-release `## Translations` credits (scripts/translators.sh)
|
|
# can resolve them to npubs. Only adds rows when a genuinely new contributor
|
|
# appears.
|
|
- name: Seed translator placeholders from Crowdin
|
|
run: bash scripts/translators.sh --seed
|
|
env:
|
|
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
|
|
- name: Open or update the combined Crowdin PR
|
|
# peter-evans/create-pull-request is MIT-licensed CI-only tooling (not
|
|
# linked into any shipped artifact). It no-ops when there is no diff.
|
|
uses: peter-evans/create-pull-request@v7
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
base: main
|
|
branch: l10n_crowdin_translations
|
|
add-paths: |
|
|
amethyst/src/main/res/**/strings.xml
|
|
docs/changelog/translators.json
|
|
commit-message: 'chore: sync Crowdin translations and seed translator npub placeholders'
|
|
title: 'New Crowdin Translations'
|
|
body: |
|
|
New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action).
|
|
|
|
Any new Crowdin contributors were added to `docs/changelog/translators.json`
|
|
with blank npubs. Fill in the npubs you have so the next release's
|
|
`## Translations` credits generate automatically via
|
|
`scripts/translators.sh --from <prev-tag> --to <this-tag>`.
|