chore(ci): add workflow to upload glossary to crowdin (#2220)
This pull request adds a workflow to upload the TBX output from the glossary to Crowdin. Improves #2148. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
parent
4f7a9d63e9
commit
42aaa514a6
@@ -0,0 +1,45 @@
|
||||
name: Upload Crowdin Glossary
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
upload-glossary:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# An empty ID fails inside the CLI with an unclear message. Fail here instead.
|
||||
- name: Check Glossary ID
|
||||
run: |
|
||||
if [ -z "${{ vars.CROWDIN_GLOSSARY_ID }}" ]; then
|
||||
echo "::error::Set the CROWDIN_GLOSSARY_ID repository variable. To find the ID, run: crowdin glossary list"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- uses: actions/checkout@v6
|
||||
- uses: pnpm/action-setup@v5
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
# The TBX file is generated, never committed, so it cannot drift from terms.yaml.
|
||||
# The schema also rejects a malformed entry here, before anything reaches Crowdin.
|
||||
- name: Generate TBX File
|
||||
run: pnpm -F @proj-airi/i18n glossary:build
|
||||
|
||||
# NOTICE: Crowdin does not document whether an import merges into the existing
|
||||
# concepts or adds duplicates beside them, and a merge cannot be undone. This
|
||||
# workflow therefore runs on demand only. After each run, compare the concept count
|
||||
# in Crowdin with the number printed above. See https://support.crowdin.com/glossary/
|
||||
- name: Upload Glossary
|
||||
uses: crowdin/github-action@v2
|
||||
with:
|
||||
command: glossary upload
|
||||
command_args: packages/i18n/glossary/glossary.tbx --id=${{ vars.CROWDIN_GLOSSARY_ID }}
|
||||
env:
|
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||
Generated
+235
-1666
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user