-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: refusing download if platform is web
- Loading branch information
1 parent
ccba771
commit 9b15c59
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Makefile for deploying the Flutter web projects to GitHub | ||
|
||
BASE_HREF = /$(OUTPUT)/ | ||
# Replace this with your GitHub username | ||
GITHUB_USER = Ericles-Porty | ||
GITHUB_REPO = https://github.com/$(GITHUB_USER)/$(OUTPUT) | ||
BUILD_VERSION := $(shell grep 'version:' pubspec.yaml | awk '{print $$2}') | ||
|
||
# Deploy the Flutter web project to GitHub | ||
deploy: | ||
ifndef OUTPUT | ||
$(error OUTPUT is not set. Usage: make deploy OUTPUT=<output_repo_name>) | ||
endif | ||
|
||
@echo "Clean existing repository" | ||
flutter clean | ||
|
||
@echo "Getting packages..." | ||
flutter pub get | ||
|
||
@echo "Generating the web folder..." | ||
flutter create . --platform web | ||
|
||
@echo "Building for web..." | ||
flutter build web --base-href $(BASE_HREF) --release | ||
|
||
@echo "Deploying to git repository" | ||
cd build/web && \ | ||
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 "✅ Finished deploy: $(GITHUB_REPO)" | ||
@echo "🚀 Flutter web URL: https://$(GITHUB_USER).github.io/$(OUTPUT)/" | ||
|
||
.PHONY: deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters