-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 1.16 KB
/
Copy pathMakefile
File metadata and controls
40 lines (31 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Makefile for deploying the Flutter web project to GitHub
OWNER = bizz84
NAME = flutter_ship_app_web
BASE_HREF = /$(NAME)/
GITHUB_REPO = https://github.com/$(OWNER)/$(NAME)
BUILD_VERSION := $(shell grep 'version:' pubspec.yaml | awk '{print $$2}')
# Deploy the Flutter web project to GitHub
deploy:
@echo "Clean existing repository"
flutter clean
@echo "Getting packages..."
flutter pub get
@echo "Running generators..."
dart run build_runner build -d
@echo "Building for web..."
flutter build web -t lib/main_prod.dart --dart-define=WEB_FLAVOR=prod --dart-define-from-file=.env.prod --base-href $(BASE_HREF) --release --source-maps
@echo "Deploying to git repository"
cd build/web && \
rm -rf .git/ && \
git init && \
git add . && \
git commit -m "Deploy Version $(BUILD_VERSION)" && \
git branch -M main && \
git remote add origin $(GITHUB_REPO) && \
git push -u -f origin main
@echo "Running Sentry Dart plugin..."
dart run sentry_dart_plugin --sentry-define=upload_source_maps=true --sentry-define=upload_sources=true
cd ../..
@echo "✅ Finished deploy: $(GITHUB_REPO)"
@echo "🚀 Flutter web URL: https://$(OWNER).github.io/$(NAME)/"
.PHONY: deploy