name: crowdin
on:
  push:
    branches:
      - master
# run sequentially (per branch)
concurrency: "crowdin-upload-${{ github.ref }}"
jobs:
  upload-sources:
    runs-on: ubuntu-latest
    if: github.repository == 'beemdevelopment/Aegis'
    steps:
      - uses: actions/checkout@v4
      - name: Install crowdin-cli
        run: |
          wget https://github.com/crowdin/crowdin-cli/releases/download/4.6.1/crowdin-cli.zip
          echo "7afd70de3a747ac631a5bad7866008163ae1d50c4606b5773f0b90a5481ffde2  crowdin-cli.zip" | sha256sum -c
          unzip crowdin-cli.zip -d crowdin-cli
      - name: Upload to Crowdin
        env:
          CROWDIN_PERSONAL_TOKEN: "${{ secrets.CROWDIN_TOKEN }}"
        run: |
          java -jar ./crowdin-cli/4.6.1/crowdin-cli.jar upload sources \
            --no-progress \
            --branch master
