Created
March 28, 2025 09:46
-
-
Save marnixk/c748fb6c8ee9fb3e06682efdd45f232c to your computer and use it in GitHub Desktop.
Flutter Web builds to Cloudflare Pages
This file contains hidden or 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
%.PHONY: clean build usage | |
CURRENT_BRANCH=$(shell git branch --show-current) | |
ifndef BUILD_VERSION | |
$(error BUILD_VERSION variable is not set. Please refer to the README.md for build instructions.) | |
endif | |
usage: | |
@echo "Use `make build` to build the web version of the Flutter app. It will be available in `target/`" | |
clean: | |
rm -rf target/* | |
build: clean | |
echo "Current branch: ${CURRENT_BRANCH}" | |
git checkout -b ${RELEASE_BRANCH}-${BUILD_VERSION} | |
flutter build web --build-name ${RELEASE_BRANCH}-${BUILD_VERSION} | |
mkdir -p target | |
cp -r build/web/* target | |
mv target/assets/assets/* target/assets/ | |
git add target/* | |
git commit -a -m "Build artifact for version: ${RELEASE_BRANCH}-${BUILD_VERSION}" | |
git push origin ${RELEASE_BRANCH}-${BUILD_VERSION} | |
git checkout ${CURRENT_BRANCH} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment