Skip to content

Crowdin upload files #404

Crowdin upload files

Crowdin upload files #404

name: Crowdin upload files
# Triggers the workflow every night
on:
schedule:
- cron: "0 3 * * 0"
workflow_dispatch:
jobs:
list-branches:
runs-on: ubuntu-22.04
outputs:
branches: ${{ steps.extract_branches.outputs.branches }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: List branches
id: extract_branches
uses: bonitasoft/actions/packages/list-branches@v3
with:
branches_list: "develop support/.*"
devUpload:
name: Crowdin upload
runs-on: ubuntu-20.04
needs: list-branches
strategy:
max-parallel: 1
matrix:
branch: ${{ fromJSON(needs.list-branches.outputs.branches) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Install Yarn
run: npm install -g yarn
- name: Install gettext
run: sudo apt-get install gettext
- name: Build pot files
run: |
cd generator-angularjs
yarn install && npm run pot
- name: Concatenate pot files
run: |
cd generator-angularjs
mkdir -p target/crowdin
cat `find . -name '*.pot' -print` | msguniq -s > target/crowdin/widgets-lang-template.pot
- name: Set Crowdin branch name
run: |
echo "crowdinBranch=$(echo ${{ matrix.branch }} | tr / -)" >> $GITHUB_ENV
- name: Retrieve secrets from Keeper
uses: Keeper-Security/ksm-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |
${{ vars.KEEPER_CROWDIN_RECORD_ID }}/field/login > env:CROWDIN_PROJECT_ID
${{ vars.KEEPER_CROWDIN_RECORD_ID }}/field/password > env:CROWDIN_PERSONAL_TOKEN
- name: crowdin action
uses: crowdin/github-action@v2
with:
upload_sources: true
crowdin_branch_name: ${{ env.crowdinBranch }}
upload_translations: false
download_translations: false
dryrun_action: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Send message to Slack channel
if: ${{ failure() }}
uses: bonitasoft/notify-slack-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
channel-id: ${{ vars.UID_SLACK_CHANNEL_ID }}
message: ":x: Upload ${{ matrix.branch }} crowdin key failed in UI-Designer Artifact Builder."