Skip to content

Commit

Permalink
.github: invoke gen-i10n.sh in build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wfleischer committed Jan 4, 2025
1 parent 7e90a6d commit 8efb5d0
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:

- run: flutter --version
- run: flutter pub get
- run: ./gen-i10n.sh
- run: flutter build apk
- run: flutter build appbundle

Expand All @@ -54,7 +55,9 @@ jobs:
channel: 'stable'
architecture: x64

- run: flutter --version
- run: flutter pub get
- run: ./gen-i10n.sh
- run: flutter build ios --release --no-codesign

- uses: actions/upload-artifact@v3
Expand All @@ -71,9 +74,16 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter --version
- run: flutter pub get
- run: ./gen-i10n.sh
- run: flutter build web

- uses: actions/upload-artifact@v3
with:
name: Web
path: build/web

build-windows:
name: Build Windows
runs-on: windows-latest
Expand All @@ -83,9 +93,17 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter --version
- run: flutter pub get
- run: cmd /c win-gen-i10n.bat
- run: flutter config --enable-windows-desktop
- run: flutter build windows

- uses: actions/upload-artifact@v3
with:
name: Windows
path: build\windows\x64\runner\Release\NWT_Reading.exe

build-linux:
name: Build Linux
runs-on: ubuntu-latest
Expand All @@ -99,9 +117,17 @@ jobs:
- run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- run: flutter --version
- run: flutter pub get
- run: ./gen-i10n.sh
- run: flutter config --enable-linux-desktop
- run: flutter build linux

- uses: actions/upload-artifact@v3
with:
name: Linux
path: build/linux/x64/release/bundle/nwt_reading

build-macos:
name: Build macOS
runs-on: macos-latest
Expand All @@ -113,5 +139,13 @@ jobs:
channel: 'stable'
architecture: x64

- run: flutter --version
- run: flutter pub get
- run: ./gen-i10n.sh
- run: flutter config --enable-macos-desktop
- run: flutter build macos

- uses: actions/upload-artifact@v3
with:
name: macOS
path: build/macos/Build/Products/Release/NWT Reading.app
31 changes: 31 additions & 0 deletions win-gen-i10n.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@echo off

echo Generating App Localizations
call flutter gen-l10n ^
--arb-dir assets/localization ^
--no-nullable-getter ^
--output-localization-file app_localizations.dart ^
--preferred-supported-locales en ^
--template-arb-file app_en.arb ^
--untranslated-messages-file i18n_untranslated_app.json ^
--use-escaping
if %errorlevel% neq 0 (
echo Error generating app l10n
echo Error code: %errorlevel%
)

echo Generating Location Localizations
call flutter gen-l10n ^
--arb-dir assets/localization/locations ^
--no-nullable-getter ^
--output-class LocationsLocalizations ^
--output-localization-file locations_localizations.dart ^
--preferred-supported-locales en ^
--template-arb-file locations_en.arb ^
--untranslated-messages-file i18n_untranslated_locations.json ^
--use-escaping
if %errorlevel% neq 0 (
echo Error generating locations l10n
echo Error code: %errorlevel%
exit /b 1
)

0 comments on commit 8efb5d0

Please sign in to comment.