diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index f9fcc56..9603939 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [ "main" ] +permissions: + contents: read + jobs: build: name: Build Flutter-Pi Bundle (${{ matrix.arch }}, ${{ matrix.cpu}}) @@ -35,7 +38,7 @@ jobs: with: cache: true channel: stable - flutter-version: 3.38.0 + flutter-version: 3.38.4 - name: Install dependencies & Activate as global executable run: | @@ -47,19 +50,21 @@ jobs: - name: Run flutterpi_tool build working-directory: test_app + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} run: | echo '::group::flutterpi_tool build ... --debug-unoptimized' - flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --debug-unoptimized --debug-symbols + flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --debug-unoptimized --debug-symbols --verbose echo '::endgroup::' echo '::group::flutterpi_tool build ... --debug' - flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --debug --debug-symbols + flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --debug --debug-symbols --verbose echo '::endgroup::' echo '::group::flutterpi_tool build ... --profile' - flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --profile --debug-symbols + flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --profile --debug-symbols --verbose echo '::endgroup::' echo '::group::flutterpi_tool build ... --release' - flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --release --debug-symbols + flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --release --debug-symbols --verbose echo '::endgroup::' diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 332f1e2..cabccc1 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -11,9 +11,14 @@ on: pull_request: branches: [ "main" ] +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} steps: - uses: actions/checkout@v4 @@ -21,7 +26,7 @@ jobs: with: cache: true channel: stable - flutter-version: 3.38.0 + flutter-version: 3.38.4 - name: Install dependencies run: flutter pub get diff --git a/CHANGELOG.md b/CHANGELOG.md index c843cad..a25f433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## unreleased + +- flutter 3.38.4 compatibility +- fix hook results not rebuilding on hot reload +- try to source github authentication token from GITHUB_TOKEN environment + variable + ## 0.10.0 - 2025-12-10 - support flutter 3.38 diff --git a/lib/src/build_system/extended_environment.dart b/lib/src/build_system/extended_environment.dart index 0e8d470..8835118 100644 --- a/lib/src/build_system/extended_environment.dart +++ b/lib/src/build_system/extended_environment.dart @@ -111,4 +111,13 @@ class ExtendedEnvironment implements Environment { final FlutterpiArtifacts artifacts; final MoreOperatingSystemUtils operatingSystemUtils; + + @override + ExtendedEnvironment copyWith({Directory? outputDir}) { + return ExtendedEnvironment.wrap( + delegate: _delegate.copyWith(outputDir: outputDir), + operatingSystemUtils: operatingSystemUtils, + artifacts: artifacts, + ); + } } diff --git a/lib/src/cli/flutterpi_command.dart b/lib/src/cli/flutterpi_command.dart index 6e37b74..51da8c6 100644 --- a/lib/src/cli/flutterpi_command.dart +++ b/lib/src/cli/flutterpi_command.dart @@ -39,7 +39,10 @@ mixin FlutterpiCommandMixin on fl.FlutterCommand { httpClient ??= http.Client(); final String? token; - if (argParser.options.containsKey('github-artifacts-auth-token')) { + if (globals.platform.environment['GITHUB_TOKEN'] case final envToken?) { + globals.logger.printTrace('Using GITHUB_TOKEN from environment.'); + token = envToken; + } else if (argParser.options.containsKey('github-artifacts-auth-token')) { token = stringArg('github-artifacts-auth-token'); } else { token = null; diff --git a/lib/src/context.dart b/lib/src/context.dart index ca4c2d6..10560fe 100644 --- a/lib/src/context.dart +++ b/lib/src/context.dart @@ -96,6 +96,7 @@ Future runInContext( processUtils: globals.processUtils, defaultRemote: '', ), + fl.FlutterHookRunner: () => fl.FlutterHookRunnerNative(), }, ); } diff --git a/lib/src/fltool/common.dart b/lib/src/fltool/common.dart index e39dff1..19e2331 100644 --- a/lib/src/fltool/common.dart +++ b/lib/src/fltool/common.dart @@ -87,3 +87,5 @@ export 'package:flutter_tools/src/build_system/exceptions.dart'; export 'package:flutter_tools/src/build_system/targets/assets.dart'; export 'package:flutter_tools/src/web/devfs_config.dart'; export 'package:flutter_tools/src/build_system/targets/native_assets.dart'; +export 'package:flutter_tools/src/hook_runner.dart'; +export 'package:flutter_tools/src/build_system/targets/hook_runner_native.dart';