From 40ac95e8e665d20ed736c621fbccc01d130ce31f Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Sun, 22 Feb 2026 10:48:22 -0800 Subject: [PATCH] wrangler deploy --- .github/workflows/deploy.yml | 38 ++++++++++++++++++++++++++++++++++ package.json | 7 +++++++ pubspec.lock | 40 ++++++++++++++++++++++++++++++++++++ pubspec.yaml | 14 +++++++++++++ wrangler.toml | 7 +++++++ 5 files changed, 106 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 package.json create mode 100644 wrangler.toml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..892a95e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,38 @@ +name: Deploy to Cloudflare Workers + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + # Match local development version which provides Dart 3.11.0 + flutter-version: '3.41.2' + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Get dependencies + run: flutter pub get + + - name: Build Web + run: bun run build + + - name: Deploy to Cloudflare + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: deploy diff --git a/package.json b/package.json new file mode 100644 index 0000000..1684721 --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "name": "meshcore-open", + "scripts": { + "build": "dart run build_pipe:build", + "deploy": "bun x wrangler deploy" + } +} diff --git a/pubspec.lock b/pubspec.lock index f695838..18eaff5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,14 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _discoveryapis_commons: + dependency: transitive + description: + name: _discoveryapis_commons + sha256: "113c4100b90a5b70a983541782431b82168b3cae166ab130649c36eb3559d498" + url: "https://pub.dev" + source: hosted + version: "1.0.7" archive: dependency: transitive description: @@ -41,6 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + build_pipe: + dependency: "direct main" + description: + name: build_pipe + sha256: "3cdfd6e2327805074a9a5c815e49b1cb781764c57d84097c257e0dce4534f419" + url: "https://pub.dev" + source: hosted + version: "0.3.1" cached_network_image: dependency: "direct main" description: @@ -365,6 +381,30 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" + url: "https://pub.dev" + source: hosted + version: "0.3.3+1" + googleapis: + dependency: transitive + description: + name: googleapis + sha256: "692fb9e90c321b61a7a2123de0353ec8a20691cd979db2553d8d732f710f6535" + url: "https://pub.dev" + source: hosted + version: "15.0.0" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + sha256: b81fe352cc4a330b3710d2b7ad258d9bcef6f909bb759b306bf42973a7d046db + url: "https://pub.dev" + source: hosted + version: "2.0.0" gpx: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index f5ceaaf..a17edde 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,7 @@ dependencies: gpx: ^2.3.0 path_provider: ^2.1.5 share_plus: ^12.0.1 + build_pipe: ^0.3.1 dev_dependencies: flutter_test: @@ -124,3 +125,16 @@ flutter_launcher_icons: # # For details regarding fonts from package dependencies, # see https://flutter.dev/to/font-from-package + +build_pipe: + workflows: + default: + clean_flutter: true # Optional: Cleans old build artifacts before running + generate_log: true # Optional: Outputs a build log file for debugging + platforms: + web: + build: + build_command: flutter build web --release --pwa-strategy=none + # Strongly recommended: disables the default service worker which often causes more cache headaches + add_version_query_param: true + # This is the key flag! It appends ?v= to bootstrap/JS files \ No newline at end of file diff --git a/wrangler.toml b/wrangler.toml new file mode 100644 index 0000000..f3c57d9 --- /dev/null +++ b/wrangler.toml @@ -0,0 +1,7 @@ +#:schema node_modules/wrangler/config-schema.json +name = "meshcore" +compatibility_date = "2025-10-08" + +[assets] +directory = "build/web" +