File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 35
35
- uses : DeterminateSystems/magic-nix-cache-action@main
36
36
37
37
- name : install tools
38
- run : nix profile add "nixpkgs#just" && just -V
38
+ run : |
39
+ nix profile add "nixpkgs#just" && just -V
40
+ nix profile add "nixpkgs#fd" && fd -V
41
+ nix profile add "nixpkgs#jq" && jq -V
39
42
40
43
- uses : actions/setup-node@v4
41
44
with :
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ spoilers-font-file := "frontend/public/SpoilersAhead.otf"
9
9
dev : download-spoilers-font (yarn " dev --host --port 8080" )
10
10
11
11
# build frontend
12
- build : download-spoilers-font (yarn-prod " build" )
12
+ build : download-spoilers-font minify-json (yarn-prod " build" )
13
13
14
14
# run frontend in prod mode
15
15
preview : download-spoilers-font (yarn-prod " preview" )
@@ -30,6 +30,24 @@ download-spoilers-font:
30
30
wget " {{ spoilers-font }} " -O " {{ spoilers-font-file }} " ; \
31
31
fi
32
32
33
+ minify-json :
34
+ #!/usr/bin/env bash
35
+ if [[ " $CI" == " " ]]; then
36
+ echo ignoring minifying in non-ci
37
+ exit
38
+ fi
39
+
40
+ set -euo pipefail
41
+
42
+ cd frontend
43
+ for p in $(fd .json public); do
44
+ echo minifying $p
45
+
46
+ tmp=" $(mktemp)"
47
+ jq -c . " $p" > " $tmp"
48
+ mv " $tmp" " $p"
49
+ done
50
+
33
51
# extract game translations
34
52
extract-translations :
35
53
cargo r --release --package tr-extractor -- --write -vv --output-dir=frontend/ public
You can’t perform that action at this time.
0 commit comments