Test sorting
All checks were successful
Pull Request Pipeline / lint (pull_request) Has been skipped
Pull Request Pipeline / test (pull_request) Has been skipped
Pull Request Pipeline / localizations (pull_request) Has been skipped
Pull Request Pipeline / sort_arb_files (pull_request) Successful in 26s

This commit is contained in:
2026-05-22 15:58:04 +02:00
parent 827808a6c5
commit 3a1092cf7d
2 changed files with 61 additions and 7 deletions

View File

@@ -101,12 +101,65 @@ jobs:
echo "All messages translated." echo "All messages translated."
sort_arb_files:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Required for Flutter action
- name: Install jq
run: |
apt-get update
apt-get install -y jq
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.41.0
- name: Get dependencies
run: |
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.41.0-x64
flutter pub get
- name: Sort .arb-Files
run: |
for file in lib/l10n/intl_*.arb; do
if [ -f "$file" ]; then
echo "Sorting $file"
dart run arb_utils sort $file
exit 1
fi
done
# git fetch origin ${{ gitea.ref_name }} - name: Check for changes
# git checkout ${{ gitea.ref_name }} id: check_changes
# git pull origin ${{ gitea.ref_name }} run: |
# git push origin HEAD:${{ gitea.ref_name }} if [ -n "$(git status --porcelain lib/l10n/arb)" ]; then
echo "has_changes=true" >> "$GITHUB_OUTPUT"
else
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi
- name: Commit generated localizations
if: steps.check_changes.outputs.has_changes == 'true'
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
BRANCH_NAME: ${{ gitea.head_ref }}
run: |
git fetch origin "$BRANCH_NAME"
git checkout "$BRANCH_NAME"
if [ -n "$(git status --porcelain lib test)" ]; then
git config --global user.name "Gitea Actions [bot]"
git config --global user.email "actions@yannick-weigert.de"
git config pull.rebase false
git pull origin "$BRANCH_NAME"
git add lib/l10n
git commit -m "Generated localizations [skip ci]"
git push origin "HEAD:$BRANCH_NAME"
else
echo "No changes to commit"
fi

View File

@@ -32,6 +32,7 @@ dependencies:
uuid: ^4.5.2 uuid: ^4.5.2
dev_dependencies: dev_dependencies:
arb_utils: ^0.11.0
flutter_test: flutter_test:
sdk: flutter sdk: flutter
build_runner: ^2.7.0 build_runner: ^2.7.0