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

Commit 4c2d0e6

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

File tree

3 files changed

+55
-22
lines changed

3 files changed

+55
-22
lines changed

.github/workflows/daily_release.yml

+16
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,22 @@ jobs:
3333
- name: Install dependencies
3434
run: yarn
3535

36+
- name: Shrink to zip
37+
run: |
38+
sh ./scripts/shrink.sh
39+
unzip -o -d ./build ./build/trex.zip
40+
cd ./build
41+
yarn install
42+
yarn tk:ext dist
43+
ls -l platforms/tktrex/extension/dist/*.zip
44+
yarn yt:ext dist
45+
ls -l platforms/yttrex/extension/dist/*.zip
46+
yarn ycai build
47+
ls -l platforms/ycai/studio/build/extension/*.zip
48+
49+
50+
51+
3652
# - name: Test project
3753
# run: yarn test
3854

scripts/install-from-shrinkzip.sh

+12-5
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

+27-17
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ mkdir -p build;
2121
# exit;
2222
# fi
2323

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

2828
# this should not be present anyways
2929
echo "Removing node_modules"
@@ -34,18 +34,25 @@ echo "Removing test files and unnecessary folders"
3434
# rm -rf platforms/*/backend
3535

3636
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
37+
echo -e "## Extension reviewer TODOs\n\n" > TODO.md
38+
echo -e 'Place the `trex.zip` in a folder an unzip it \n' >> TODO.md
39+
echo -e "### Requirements\n" >> TODO.md
40+
echo -e '- yarn `v3`\n - node `16` \n' >> TODO.md
41+
echo -e "#### Installation \n" >> TODO.md
42+
echo -e 'Install dependencies\n' >> TODO.md
43+
echo -e '```bash\nyarn\n```\n' >> TODO.md
44+
echo -e "tktrex is tiktok.tracking.exposed extension\n" >> TODO.md
45+
echo -e '```bash\nyarn tk:ext dist\nls -l platforms/tktrex/extension/dist/*.zip\n```\n' >> TODO.md
46+
echo -e "yttrex is youtube.tracking.exposed extension\n" >> TODO.md
47+
echo -e '```bash\nyarn yt:ext dist\nls -l platforms/yttrex/extension/dist/*.zip\n```\n' >> TODO.md
48+
echo -e "ycai is youchoose.ai extension\n" >> TODO.md
49+
echo -e '```bash\nyarn ycai build\nls -l platforms/ycai/studio/build/extension/*.zip\n```\n' >> TODO.md
4150

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

4654
zip $fileout -r ./* \
47-
.npmrc .nvmrc .yarn .yarnrc.yml \
48-
-x "yarn.lock" \
55+
.npmrc .nvmrc .yarn .yarnrc.yml \
4956
-x ".yarn/unplugged/**" \
5057
-x ".yarn/cache/**" \
5158
-x ".vscode/**" \
@@ -56,12 +63,15 @@ zip $fileout -r ./* \
5663
-x "**/__tests__/**" \
5764
-x "docs/**" -x "**/docs/**" \
5865
-x "coverage/**" -x "**/coverage/**" \
66+
-x "downloads/**" -x "**/downloads/**" \
67+
-x "logs/**" -x "**/logs/**" \
5968
-x "docker/**" \
6069
-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/**" \
70+
-x "scripts/**" -x "**/scripts/**"
71+
72+
zip $fileout scripts/install-from-shrinkzip.sh
73+
74+
rm README.md
75+
mv .README.md README.md
6676

6777
echo "done!"

0 commit comments

Comments
 (0)