Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Commit 73fd1d0

Browse files
committed
chore(workspace): extension reviewer install from zip, closes #649 (#677)
1 parent 6688017 commit 73fd1d0

3 files changed

Lines changed: 48 additions & 21 deletions

File tree

.github/workflows/daily_release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
- name: Install dependencies
3434
run: yarn
3535

36+
- name: Shrink to zip
37+
run: |
38+
sh ./scripts/shrink.sh
39+
sh ./scripts/install-from-shrinkzip.sh ./build/trex.zip ../trex-shrink-test
40+
41+
3642
# - name: Test project
3743
# run: yarn test
3844

scripts/install-from-shrinkzip.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
#!/usr/bin/bash
22

3-
set -x
3+
set -ex
44

55
# This script is necessary to produce the .zip files to submit to mozilla store
66
# Otherwise the repo is too big
77

8-
out=../trex-from-zip
8+
from=${1:-./build/trex.zip}
9+
out=${2:-./build}
910

1011
mkdir -p $out
1112

1213
# cp ./build/trex.zip $out/
1314

14-
unzip -o -d $out build/trex.zip
15+
unzip -o -d $out $from
1516

1617
cd $out || exit
1718

19+
ls -la
20+
1821
yarn install
1922

20-
yarn tk:ext build
21-
yarn yt:ext build
23+
yarn tk:ext dist
24+
ls -l platforms/tktrex/extension/dist/*.zip
25+
yarn yt:ext dist
26+
ls -l platforms/yttrex/extension/dist/*.zip
2227
yarn ycai build
28+
ls -l platforms/ycai/studio/build/extension/*.zip
29+

scripts/shrink.sh

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ mkdir -p build;
2121
# exit;
2222
# fi
2323

24+
suffix=$('grep version package.json | sed -es/.*:// | sed -es/[\ \",]//g')
25+
fileout="build/trex${suffix}.zip"
26+
echo "zipping in $fileout"
27+
2428
# this is the biggest cache
25-
echo "Removing .yarn/cache"
26-
# rm -rf .yarn/cache
29+
echo "Remove previous zip"
30+
rm build/trex*.zip
2731

2832
# this should not be present anyways
2933
echo "Removing node_modules"
@@ -34,18 +38,27 @@ echo "Removing test files and unnecessary folders"
3438
# rm -rf platforms/*/backend
3539

3640
echo "Creating new version of README for extension reviewer"
37-
echo -e "### Extension reviewer TODOs\n\n yarn\n yarn tk:ext dist\n ls -l platforms/tktrex/extension/dist/*.zip\n yarn yt:ext dist\n ls -l platforms/yttrex/extension/dist/*.zip\n yarn ycai build\n ls -l platforms/ycai/studio/build/extension/*.zip\n\n" > README.md
38-
echo "tktrex is tiktok.tracking.exposed extension" >> README.md
39-
echo "yttrex is youtube.tracking.exposed extension" >> README.md
40-
echo "ycai is youchoose.ai extension" >> README.md
41+
echo -e "## Extension reviewer TODOs\n\n" > TODO.md
42+
echo -e 'Place the `trex.zip` in a folder an unzip it \n' >> TODO.md
43+
echo -e "### Requirements\n" >> TODO.md
44+
echo -e '- yarn `v3`\n - node `16` \n' >> TODO.md
45+
echo -e "#### Automatic installation\n" >> TODO.md
46+
echo -e '```bash\n./scripts/install-from-shrinkzip.sh ./trex.zip ./\n```\n' >> TODO.md
47+
echo -e "#### Manual installation \n" >> TODO.md
48+
echo -e 'Install dependencies\n' >> TODO.md
49+
echo -e '```bash\nyarn\n```\n' >> TODO.md
50+
echo -e "tktrex is tiktok.tracking.exposed extension\n" >> TODO.md
51+
echo -e '```bash\nyarn tk:ext dist\nls -l platforms/tktrex/extension/dist/*.zip\n```\n' >> TODO.md
52+
echo -e "yttrex is youtube.tracking.exposed extension\n" >> TODO.md
53+
echo -e '```bash\nyarn yt:ext dist\nls -l platforms/yttrex/extension/dist/*.zip\n```\n' >> TODO.md
54+
echo -e "ycai is youchoose.ai extension\n" >> TODO.md
55+
echo -e '```bash\nyarn ycai build\nls -l platforms/ycai/studio/build/extension/*.zip\n```\n' >> TODO.md
4156

42-
suffix=$('grep version package.json | sed -es/.*:// | sed -es/[\ \",]//g')
43-
fileout="build/trex${suffix}.zip"
44-
echo "zipping in $fileout"
57+
mv README.md .README.md
58+
mv TODO.md README.md
4559

4660
zip $fileout -r ./* \
47-
.npmrc .nvmrc .yarn .yarnrc.yml \
48-
-x "yarn.lock" \
61+
.npmrc .nvmrc .yarn .yarnrc.yml \
4962
-x ".yarn/unplugged/**" \
5063
-x ".yarn/cache/**" \
5164
-x ".vscode/**" \
@@ -58,10 +71,11 @@ zip $fileout -r ./* \
5871
-x "coverage/**" -x "**/coverage/**" \
5972
-x "docker/**" \
6073
-x "build/**" -x "**/build/**" \
61-
-x "platforms/guardoni/**" \
62-
-x "platforms/tktrex/observatory/**" \
63-
-x "platforms/tktrex/ua-observatory/**" \
64-
-x "platforms/tktrex/tt-automate/**" \
65-
-x "platforms/*/backend/**" \
74+
-x "scripts/**" -x "**/scripts/**"
75+
76+
zip $fileout scripts/install-from-shrinkzip.sh
77+
78+
rm README.md
79+
mv .README.md README.md
6680

6781
echo "done!"

0 commit comments

Comments
 (0)