New Crowdin updates #96
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update ARB Files | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
update-arb: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.16.8' | |
- name: Replace "ur-PK" with "ur" in app_ur.arb | |
run: | | |
sed -i 's/"ur-PK"/"ur"/g' lib/l10n/app_ur.arb | |
- name: Replace "es-ES" with "es" in app_es.arb | |
run: | | |
sed -i 's/"es-ES"/"es"/g' lib/l10n/app_es.arb | |
- name: Replace "pt-PT" with "pt" in app_pt.arb | |
run: | | |
sed -i 's/"pt-PT"/"pt"/g' lib/l10n/app_pt.arb | |
- name: Change intl version to 0.18.1 | |
run: | | |
sed -i 's/intl: ^0.19.0/intl: ^0.18.1/g' pubspec.yaml | |
flutter pub get | |
- name: Run flutter gen-l10n | |
run: flutter gen-l10n | |
- name: Run flutter pub run crowdin_sdk:gen | |
run: flutter pub run crowdin_sdk:gen | |
- name: Change Flutter version to 3.22.2 | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.22.2' | |
- name: Revert intl version back to 0.19.0 | |
run: | | |
sed -i 's/intl: ^0.18.1/intl: ^0.19.0/g' pubspec.yaml | |
flutter pub get | |
- name: Untrack .dart_tool and pubspec.lock | |
run: | | |
git rm --cached -r .dart_tool/ || echo ".dart_tool is not tracked" | |
git rm --cached pubspec.lock || echo "pubspec.lock is not tracked" | |
- name: Commit and push changes | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Automated ARB file updates, l10n generation, Flutter version, and intl version adjustment" || echo "No changes to commit" | |
git fetch origin | |
git rebase origin/${{ github.head_ref }} || git rebase --abort | |
git push origin HEAD:${{ github.head_ref }} | |
continue-on-error: true | |