blob: ba2ad086449f10c9f1c6cf85b799df1e7f1d0d0d [file] [log] [blame]
.PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_chromium_canary release_gecko_stable build_test_extension clean_releases clean trigger_nightly_build
WEBPACK := ./node_modules/webpack-cli/bin/cli.js
RELEASE_SCRIPT := bash tools/release.bash
(cd src/killSwitch && \
protoc -I=. --js_out=import_style=commonjs_strict:. api_proto/*.proto && \
protoc -I. --grpc-web_out=import_style=commonjs,mode=grpcwebtext:. api_proto/*.proto)
(cd src/workflows && \
protoc -I=. --js_out=import_style=commonjs_strict:. proto/*.proto)
npm ci --no-save
rm -rf dist
deps: node_deps
mkdir -p dist
rm -rf node_modules
serve_chromium: deps
$(WEBPACK) --mode development --env browser_target=chromium --watch
serve_chromium_mv3: deps
$(WEBPACK) --mode development --env browser_target=chromium_mv3 --watch
serve_gecko: deps
$(WEBPACK) --mode development --env browser_target=gecko --watch
release: release_chromium_stable release_chromium_beta release_gecko_stable
release_chromium_stable: deps
$(WEBPACK) --mode production --env browser_target=chromium
$(RELEASE_SCRIPT) -c stable -b chromium
rm -rf dist/chromium
release_chromium_beta: deps
$(WEBPACK) --mode production --env browser_target=chromium_mv3
$(RELEASE_SCRIPT) -c beta -b chromium_mv3
rm -rf dist/chromium_mv3
release_chromium_canary: deps
$(WEBPACK) --mode production --env browser_target=chromium_mv3 --env canary
$(RELEASE_SCRIPT) -c canary -b chromium_mv3
rm -rf dist/chromium_mv3
release_gecko_stable: deps
$(WEBPACK) --mode production --env browser_target=gecko
$(RELEASE_SCRIPT) -c stable -b gecko
rm -rf dist/gecko
# Target to build the extension for webext lint in the Zuul Check Pipeline.
build_test_extension: deps
$(WEBPACK) --mode production --env browser_target=gecko
$(RELEASE_SCRIPT) -c stable -b gecko
rm -rf out
clean: clean_deps clean_dist clean_releases
# Manually trigger the nightly build. It also makes sure the tracked master branch is up to update
git fetch
zuul-client enqueue-ref --tenant gerrit --pipeline nightly-build --project infinitegforums --ref refs/heads/master --newrev $$(git rev-parse gerrit/master)