Adrià Vilanova Martínez | 2c6f328 | 2024-03-20 18:59:55 +0100 | [diff] [blame] | 1 | .PHONY: node_deps clean_dist deps clean_deps lit_localize_extract lit_localize_build lit_localize_all serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_chromium_canary release_gecko_stable build_test_extension clean_releases test clean trigger_nightly_build |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 2 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 3 | WEBPACK := ./node_modules/webpack-cli/bin/cli.js |
Adrià Vilanova Martínez | d7c19de | 2024-09-27 23:26:01 +0200 | [diff] [blame^] | 4 | JEST := node ./node_modules/jest/bin/jest.js |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 5 | RELEASE_SCRIPT := bash tools/release.bash |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 6 | |
Adrià Vilanova Martínez | 413cb44 | 2021-09-06 00:30:45 +0200 | [diff] [blame] | 7 | grpc_proto_gen: |
| 8 | (cd src/killSwitch && \ |
| 9 | protoc -I=. --js_out=import_style=commonjs_strict:. api_proto/*.proto && \ |
Adrià Vilanova Martínez | 50435f8 | 2022-01-21 19:33:36 +0100 | [diff] [blame] | 10 | protoc -I. --grpc-web_out=import_style=commonjs,mode=grpcwebtext:. api_proto/*.proto) |
Adrià Vilanova Martínez | 4118859 | 2022-01-21 19:47:41 +0100 | [diff] [blame] | 11 | (cd src/workflows && \ |
| 12 | protoc -I=. --js_out=import_style=commonjs_strict:. proto/*.proto) |
Adrià Vilanova Martínez | 413cb44 | 2021-09-06 00:30:45 +0200 | [diff] [blame] | 13 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 14 | node_deps: |
Adrià Vilanova Martínez | 2e464f3 | 2024-05-31 20:02:09 +0200 | [diff] [blame] | 15 | pnpm install --frozen-lockfile |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 16 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 17 | clean_dist: |
| 18 | rm -rf dist |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 19 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 20 | deps: node_deps |
| 21 | mkdir -p dist |
avm99963 | bbc88c6 | 2020-12-25 03:44:41 +0100 | [diff] [blame] | 22 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 23 | clean_deps: |
| 24 | rm -rf node_modules |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 25 | |
Adrià Vilanova Martínez | a03d03a | 2023-03-11 23:30:07 +0100 | [diff] [blame] | 26 | lit_localize_extract: |
| 27 | npx lit-localize extract |
| 28 | |
| 29 | lit_localize_build: |
| 30 | npx lit-localize build |
| 31 | |
| 32 | lit_localize_all: lit_localize_extract lit_localize_build |
| 33 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 34 | serve_chromium_mv3: deps |
| 35 | $(WEBPACK) --mode development --env browser_target=chromium_mv3 --watch |
| 36 | |
| 37 | serve_gecko: deps |
| 38 | $(WEBPACK) --mode development --env browser_target=gecko --watch |
| 39 | |
| 40 | release: release_chromium_stable release_chromium_beta release_gecko_stable |
| 41 | |
| 42 | release_chromium_stable: deps |
Adrià Vilanova Martínez | 2c6f328 | 2024-03-20 18:59:55 +0100 | [diff] [blame] | 43 | $(WEBPACK) --mode production --env browser_target=chromium_mv3 |
| 44 | $(RELEASE_SCRIPT) -c stable -b chromium_mv3 |
| 45 | rm -rf dist/chromium_mv3 |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 46 | |
| 47 | release_chromium_beta: deps |
Adrià Vilanova Martínez | d4a4f3d | 2021-10-23 18:25:39 +0200 | [diff] [blame] | 48 | $(WEBPACK) --mode production --env browser_target=chromium_mv3 |
| 49 | $(RELEASE_SCRIPT) -c beta -b chromium_mv3 |
| 50 | rm -rf dist/chromium_mv3 |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 51 | |
Adrià Vilanova Martínez | 9aa2931 | 2022-01-16 02:42:46 +0100 | [diff] [blame] | 52 | release_chromium_canary: deps |
| 53 | $(WEBPACK) --mode production --env browser_target=chromium_mv3 --env canary |
| 54 | $(RELEASE_SCRIPT) -c canary -b chromium_mv3 |
| 55 | rm -rf dist/chromium_mv3 |
| 56 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 57 | release_gecko_stable: deps |
| 58 | $(WEBPACK) --mode production --env browser_target=gecko |
| 59 | $(RELEASE_SCRIPT) -c stable -b gecko |
| 60 | rm -rf dist/gecko |
| 61 | |
| 62 | # Target to build the extension for webext lint in the Zuul Check Pipeline. |
| 63 | build_test_extension: deps |
| 64 | $(WEBPACK) --mode production --env browser_target=gecko |
| 65 | $(RELEASE_SCRIPT) -c stable -b gecko |
| 66 | |
| 67 | clean_releases: |
avm99963 | 6c35730 | 2020-08-09 19:54:08 +0200 | [diff] [blame] | 68 | rm -rf out |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 69 | |
Adrià Vilanova Martínez | b47ec06 | 2023-01-15 17:43:26 +0100 | [diff] [blame] | 70 | test: |
| 71 | $(JEST) |
| 72 | |
Adrià Vilanova Martínez | 3465e77 | 2021-07-11 19:18:41 +0200 | [diff] [blame] | 73 | clean: clean_deps clean_dist clean_releases |
Adrià Vilanova Martínez | b4af975 | 2022-06-21 12:09:58 +0200 | [diff] [blame] | 74 | |
| 75 | # Manually trigger the nightly build. It also makes sure the tracked master branch is up to update |
| 76 | trigger_nightly_build: |
| 77 | git fetch |
| 78 | zuul-client enqueue-ref --tenant gerrit --pipeline nightly-build --project infinitegforums --ref refs/heads/master --newrev $$(git rev-parse gerrit/master) |