From 4cb3ad768de7e7a0e84cb3b570116c8b3422301b Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 00:13:55 +0100 Subject: [PATCH 1/9] remove devcontainer --- .devcontainer/Dockerfile | 15 --------------- .devcontainer/devcontainer.json | 33 --------------------------------- 2 files changed, 48 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 034392e..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM mcr.microsoft.com/devcontainers/base:debian - -# Install needed packages -RUN apt-get update && apt-get install -y curl git unzip xz-utils zip - -USER 1000:1000 - -ARG FLUTTER_VERSION=3.22.1 -RUN git clone -b $FLUTTER_VERSION https://github.com/flutter/flutter.git /home/vscode/flutter - -ENV PATH /home/vscode/flutter/bin:/home/vscode/.pub-cache/bin:$PATH - -RUN flutter precache - -USER root diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index d2721df..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,33 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/debian -{ - "name": "Debian", - - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "build": { - // Path is relative to the devcontainer.json file. - "dockerfile": "Dockerfile" - }, - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Configure tool-specific properties. - // "customizations": {}, - - "customizations": { - "vscode": { - "extensions": [ - "Dart-Code.flutter" - ] - } - }, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" - - "postStartCommand": "flutter pub global activate -spath /workspaces/flutterpi_tool" -} From 4d871894c626593a5bdcaf503bc4199970878f1d Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 00:22:28 +0100 Subject: [PATCH 2/9] improve windows testing build all test apps on windows as well. run all tests on macos, windows and linux. --- .github/workflows/build-app.yml | 20 +++++++++------ .github/workflows/flutter.yml | 43 ++++++++++++++++++++++++--------- 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 9603939..d980a51 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -2,19 +2,25 @@ name: Build Test App on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] permissions: contents: read +env: + FLUTTER_VERSION: 3.38.4 + jobs: build: name: Build Flutter-Pi Bundle (${{ matrix.arch }}, ${{ matrix.cpu}}) - runs-on: ubuntu-latest + runs-on: ${{ matrix.runner }} strategy: matrix: + runner: + - windows-latest + - ubuntu-latest arch: - arm - arm64 @@ -33,13 +39,13 @@ jobs: cpu: pi4 steps: - uses: actions/checkout@v4 - + - uses: subosito/flutter-action@v2 with: cache: true channel: stable - flutter-version: 3.38.4 - + flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Install dependencies & Activate as global executable run: | flutter pub get @@ -60,7 +66,7 @@ jobs: echo '::group::flutterpi_tool build ... --debug' 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 --verbose echo '::endgroup::' diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index cabccc1..aa1a49f 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -7,39 +7,60 @@ name: Flutter on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] permissions: contents: read +env: + FLUTTER_VERSION: 3.38.4 + jobs: - build: + analyze: runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.TOKEN }} steps: - uses: actions/checkout@v4 - + - uses: subosito/flutter-action@v2 with: cache: true channel: stable - flutter-version: 3.38.4 - + flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Install dependencies run: flutter pub get - + - name: Verify formatting run: dart format --output=none --set-exit-if-changed . - # Consider passing '--fatal-infos' for slightly stricter analysis. - name: Analyze project source run: flutter analyze - # Your project will need to have tests in test/ and a dependency on - # package:test for this step to succeed. Note that Flutter projects will - # want to change this to 'flutter test'. + test: + runs-on: ${{ matrix.runner }} + env: + GITHUB_TOKEN: ${{ secrets.token }} + strategy: + matrix: + runner: + - windows-latest + - ubuntu-latest + - macos-latest + steps: + - uses: actions/checkout@v4 + + - uses: subosito/flutter-action@v2 + with: + cache: true + channel: stable + flutter-version: ${{ env.FLUTTER_VERSION }} + + - name: Install dependencies + run: flutter pub get + - name: Run tests run: flutter test From 855ea0a17b2824645eca2719cf629da78a16b2da Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 00:28:44 +0100 Subject: [PATCH 3/9] Update build-app.yml --- .github/workflows/build-app.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index d980a51..aa42459 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -28,14 +28,32 @@ jobs: - riscv64 cpu: - generic + + # TODO: Maybe find a better way to do this. include: - - arch: arm + - runner: windows-latest + arch: arm + cpu: pi3 + - runner: ubuntu-latest + arch: arm cpu: pi3 - - arch: arm + - runner: windows-latest + arch: arm + cpu: pi4 + - runner: ubuntu-latest + arch: arm cpu: pi4 - - arch: arm64 + - runner: windows-latest + arch: arm64 cpu: pi3 - - arch: arm64 + - runner: ubuntu-latest + arch: arm64 + cpu: pi3 + - runner: windows-latest + arch: arm64 + cpu: pi4 + - runner: ubuntu-latest + arch: arm64 cpu: pi4 steps: - uses: actions/checkout@v4 From 7b67fee4b36ac7a96177d456e59b88aa4158526d Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 00:30:10 +0100 Subject: [PATCH 4/9] mention OS in job name --- .github/workflows/build-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index aa42459..b05c6db 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -14,7 +14,7 @@ env: jobs: build: - name: Build Flutter-Pi Bundle (${{ matrix.arch }}, ${{ matrix.cpu}}) + name: Build Flutter-Pi Bundle (${{ matrix.runner}}, ${{ matrix.arch }}, ${{ matrix.cpu}}) runs-on: ${{ matrix.runner }} strategy: matrix: From dee2b1ec4f08d68e3ab52fbe86253bf11be41e38 Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 00:39:58 +0100 Subject: [PATCH 5/9] app builder test: replace all literal path creations with path.join --- test/app_builder_test.dart | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/test/app_builder_test.dart b/test/app_builder_test.dart index 609194d..aa70af5 100644 --- a/test/app_builder_test.dart +++ b/test/app_builder_test.dart @@ -123,7 +123,7 @@ void main() { }) async { expect( environment.defines[fl.kTargetFile], - equals('lib/main_flutterpi.dart'), + equals(p.join('lib', 'main_flutterpi.dart')), ); buildWasCalled = true; @@ -136,7 +136,7 @@ void main() { target: FlutterpiTargetPlatform.genericRiscv64, buildInfo: fl.BuildInfo.debug, fsLayout: FilesystemLayout.flutterPi, - mainPath: 'lib/main_flutterpi.dart', + mainPath: p.join('lib', 'main_flutterpi.dart'), ), ); @@ -268,7 +268,8 @@ void main() { }) async { expect( environment.outputDir.path, - equals('build/flutter-pi/meta-flutter-riscv64-generic'), + equals( + p.join('build', 'flutter-pi', 'meta-flutter-riscv64-generic')), ); buildWasCalled = true; @@ -375,7 +376,7 @@ void main() { }) async { expect( environment.outputDir.path, - equals('build/flutter-pi/riscv64-generic'), + equals(p.join('build', 'flutter-pi', 'riscv64-generic')), ); buildWasCalled = true; @@ -491,8 +492,8 @@ void main() { expect( bundle.binaries.map( - (file) => - p.relative(file.path, from: 'build/flutter-pi/riscv64-generic'), + (file) => p.relative(file.path, + from: p.join('build', 'flutter-pi', 'riscv64-generic')), ), unorderedEquals([ 'flutter-pi', @@ -525,8 +526,8 @@ void main() { expect( bundle.binaries.map( - (file) => - p.relative(file.path, from: 'build/flutter-pi/riscv64-generic'), + (file) => p.relative(file.path, + from: p.join('build', 'flutter-pi', 'riscv64-generic')), ), unorderedEquals([ 'flutter-pi', @@ -560,11 +561,11 @@ void main() { bundle.binaries.map( (file) => p.relative( file.path, - from: 'build/flutter-pi/meta-flutter-riscv64-generic', + from: p.join('build', 'flutter-pi', 'meta-flutter-riscv64-generic'), ), ), unorderedEquals([ - 'lib/libflutter_engine.so', + p.join('lib', 'libflutter_engine.so'), ]), ); }); @@ -595,12 +596,12 @@ void main() { bundle.binaries.map( (file) => p.relative( file.path, - from: 'build/flutter-pi/meta-flutter-riscv64-generic', + from: p.join('build', 'flutter-pi', 'meta-flutter-riscv64-generic'), ), ), unorderedEquals([ - 'bin/flutter-pi', - 'lib/libflutter_engine.so', + p.join('bin', 'flutter-pi'), + p.join('lib', 'libflutter_engine.so'), ]), ); }); @@ -631,12 +632,12 @@ void main() { bundle.binaries.map( (file) => p.relative( file.path, - from: 'build/flutter-pi/meta-flutter-riscv64-generic', + from: p.join('build', 'flutter-pi', 'meta-flutter-riscv64-generic'), ), ), unorderedEquals([ - 'lib/libflutter_engine.dbgsyms', - 'lib/libflutter_engine.so', + p.join('lib', 'libflutter_engine.dbgsyms'), + p.join('lib', 'libflutter_engine.so'), ]), ); }); From 3c6dd69036f3607cd88acdaf4942254d9a4b6aca Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 00:45:32 +0100 Subject: [PATCH 6/9] use GITHUB_TOKEN from environment to authenticate github requests --- lib/src/context.dart | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/src/context.dart b/lib/src/context.dart index 10560fe..b0eee14 100644 --- a/lib/src/context.dart +++ b/lib/src/context.dart @@ -7,6 +7,7 @@ import 'package:flutterpi_tool/src/build_system/build_app.dart'; import 'package:flutterpi_tool/src/config.dart'; import 'package:flutterpi_tool/src/devices/device_manager.dart'; import 'package:flutterpi_tool/src/devices/flutterpi_ssh/ssh_utils.dart'; +import 'package:github/github.dart' as gh; import 'package:unified_analytics/unified_analytics.dart'; import 'package:http/io_client.dart' as http; @@ -28,20 +29,28 @@ Future runInContext( overrides: { Analytics: () => const NoOpAnalytics(), fl.TemplateRenderer: () => const fl.MustacheTemplateRenderer(), - fl.Cache: () => FlutterpiCache( - hooks: globals.shutdownHooks, - logger: globals.logger, - fileSystem: globals.fs, - platform: globals.platform, - osUtils: globals.os as MoreOperatingSystemUtils, - projectFactory: globals.projectFactory, - processManager: globals.processManager, - github: MyGithub.caching( - httpClient: http.IOClient( - globals.httpClientFactory?.call() ?? io.HttpClient(), - ), + fl.Cache: () { + final auth = switch (globals.platform.environment['GITHUB_TOKEN']) { + final token? => gh.Authentication.bearerToken(token), + _ => null, + }; + + return FlutterpiCache( + hooks: globals.shutdownHooks, + logger: globals.logger, + fileSystem: globals.fs, + platform: globals.platform, + osUtils: globals.os as MoreOperatingSystemUtils, + projectFactory: globals.projectFactory, + processManager: globals.processManager, + github: MyGithub.caching( + httpClient: http.IOClient( + globals.httpClientFactory?.call() ?? io.HttpClient(), ), + auth: auth, ), + ); + }, fl.OperatingSystemUtils: () => MoreOperatingSystemUtils( fileSystem: globals.fs, logger: globals.logger, From b951a6d9e4b7f523846a2fb29bfb3229219e95fb Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 00:48:25 +0100 Subject: [PATCH 7/9] fix missing trailing commas --- test/app_builder_test.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/app_builder_test.dart b/test/app_builder_test.dart index aa70af5..f26b202 100644 --- a/test/app_builder_test.dart +++ b/test/app_builder_test.dart @@ -269,7 +269,8 @@ void main() { expect( environment.outputDir.path, equals( - p.join('build', 'flutter-pi', 'meta-flutter-riscv64-generic')), + p.join('build', 'flutter-pi', 'meta-flutter-riscv64-generic'), + ), ); buildWasCalled = true; @@ -492,8 +493,10 @@ void main() { expect( bundle.binaries.map( - (file) => p.relative(file.path, - from: p.join('build', 'flutter-pi', 'riscv64-generic')), + (file) => p.relative( + file.path, + from: p.join('build', 'flutter-pi', 'riscv64-generic'), + ), ), unorderedEquals([ 'flutter-pi', @@ -526,8 +529,10 @@ void main() { expect( bundle.binaries.map( - (file) => p.relative(file.path, - from: p.join('build', 'flutter-pi', 'riscv64-generic')), + (file) => p.relative( + file.path, + from: p.join('build', 'flutter-pi', 'riscv64-generic'), + ), ), unorderedEquals([ 'flutter-pi', From b8eb5fdf07dc79985a4cd2f5f4cb5c294b10eae8 Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 01:05:21 +0100 Subject: [PATCH 8/9] remove explicit permissions --- .github/workflows/build-app.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index b05c6db..d9f128a 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -6,9 +6,6 @@ on: pull_request: branches: ["main"] -permissions: - contents: read - env: FLUTTER_VERSION: 3.38.4 From aa37e3de5a08083f3822d50611644fcda6c6cf13 Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 7 Feb 2026 01:11:24 +0100 Subject: [PATCH 9/9] use public-only PAT to authenticate GH requests --- .github/workflows/build-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index d9f128a..ab6becb 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -72,7 +72,7 @@ jobs: - name: Run flutterpi_tool build working-directory: test_app env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} + GITHUB_TOKEN: ${{ secrets.PUBLIC_ONLY_PAT }} run: | echo '::group::flutterpi_tool build ... --debug-unoptimized' flutterpi_tool build --arch=${{ matrix.arch }} --cpu=${{ matrix.cpu }} --debug-unoptimized --debug-symbols --verbose