Skip to content

Commit 8742422

Browse files
alexmvgnprice
authored andcommitted
github: Add steps to update generated code as well.
1 parent b0ecf60 commit 8742422

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/update-translations.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,44 @@ on:
66
schedule:
77
- cron: "0 10 * * 1"
88
workflow_dispatch:
9+
910
jobs:
1011
update-translations:
1112
runs-on: ubuntu-latest
1213
steps:
1314
- uses: actions/checkout@v4
15+
1416
- name: Fetch and merge from Weblate
1517
# The commit message is generated in Weblate; see https://hosted.weblate.org/addon/17163/
1618
run: |
1719
git remote add weblate https://hosted.weblate.org/git/zulip/zulip-flutter/
1820
git fetch weblate
1921
git merge --ff-only weblate/main
22+
23+
- name: Clone Flutter SDK
24+
# We can't do a depth-1 clone, because we need the most recent tag
25+
# so that Flutter knows its version and sees the constraint in our
26+
# pubspec is satisfied. It's uncommon for flutter/flutter to go
27+
# more than 100 commits between tags. Fetch 1000 for good measure.
28+
run: |
29+
git clone --depth=1000 -b main https://github.com/flutter/flutter ~/flutter
30+
TZ=UTC git --git-dir ~/flutter/.git log -1 --format='%h | %ci | %s' --date=iso8601-local
31+
echo ~/flutter/bin >> "$GITHUB_PATH"
32+
33+
# The Flutter tool assumes the tip of tree is "origin/master"
34+
# (or "upstream/master"):
35+
# https://github.com/flutter/flutter/issues/160626
36+
# TODO(upstream): make workaround unneeded
37+
git --git-dir ~/flutter/.git update-ref refs/remotes/origin/master origin/main
38+
39+
- name: Update generated code
40+
run: |
41+
mkdir -p build
42+
tools/check l10n --fix
43+
git add lib/generated/l10n/
44+
GIT_COMMITTER_NAME="Hosted Weblate" GIT_COMMITTER_EMAIL="[email protected]" \
45+
git commit --amend -C HEAD
46+
2047
- name: Create Pull Request
2148
uses: peter-evans/create-pull-request@v7
2249
with:

0 commit comments

Comments
 (0)