Skip to content

Publish to Crowdin #178

Publish to Crowdin

Publish to Crowdin #178

name: Publish to Crowdin
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * WED'
repository_dispatch:
types: crowdin
permissions:
contents: write
pull-requests: write
env:
CROWDIN_API_KEY: ${{ secrets.crowdin_token}}
CROWDIN_PROJECT_ID: ${{ secrets.crowdin_identifier }}
jobs:
deploy:
if: github.repository == 'Cog-Creators/Red-Dashboard'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
curl https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list
sudo apt-get update -qq
sudo apt-get install -y crowdin
pip install flask-babel
- name: Generate source files
run: |
make gettext
- name: Upload source files
run: |
make upload_translations
- name: Download translations
run: |
make download_translations
- name: Compile translations
run: |
make compile_translations
- name: Commit compiled translations
run: |
git config user.name 'Github'
git config user.email 'noreply@github.com'
git add -f reddash/app/translations
git commit -m "Automated Crowdin downstream"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Automated Crowdin downstream
title: "[i18n] Automated Crowdin downstream"
body: |
This is an automated PR.
Please ensure that there are no errors or invalid files are in the PR.
labels: "1-area-i18n, 2-type-other, 3-changelog-skipped, 4-automated-pr"
branch: "automated/i18n"
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>