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

Commit

Permalink
chore(workspace): extension reviewer install from zip, closes #649 (#677
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ascariandrea committed Sep 22, 2022
1 parent 6688017 commit ca80437
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 22 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/daily_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,40 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache: 'yarn'
cache-dependency-path: yarn.lock

- name: Install dependencies
run: yarn

- name: Shrink to zip
run: |
./scripts/shrink.sh
pwd
cd ./build
pwd
unzip -o ./trex.zip -d ./
ls -la
yarn
yarn tk:ext dist
ls -l platforms/tktrex/extension/dist/*.zip
yarn yt:ext dist
ls -l platforms/yttrex/extension/dist/*.zip
yarn ycai build
ls -l platforms/ycai/studio/build/extension/*.zip
# - name: Test project
# run: yarn test

- name: Build Dashboard
env:
DOTENV_CONFIG_PATH: .env.beta
DEBUG: "@trex*,@YCAI*"
DEBUG: '@trex*,@YCAI*'
run: yarn ycai build

- name: Release Version
run: yarn release-it --no-github.release --release-version


- name: Deploy YCAI Dashboard
uses: burnett01/[email protected]
with:
Expand Down
17 changes: 12 additions & 5 deletions scripts/install-from-shrinkzip.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
#!/usr/bin/bash

set -x
set -ex

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

out=../trex-from-zip
from=${1:-./build/trex.zip}
out=${2:-./build}

mkdir -p $out

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

unzip -o -d $out build/trex.zip
unzip -o -d $out $from

cd $out || exit

ls -la

yarn install

yarn tk:ext build
yarn yt:ext build
yarn tk:ext dist
ls -l platforms/tktrex/extension/dist/*.zip
yarn yt:ext dist
ls -l platforms/yttrex/extension/dist/*.zip
yarn ycai build
ls -l platforms/ycai/studio/build/extension/*.zip

43 changes: 29 additions & 14 deletions scripts/shrink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ mkdir -p build;
# exit;
# fi

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

# this should not be present anyways
echo "Removing node_modules"
Expand All @@ -34,17 +34,25 @@ echo "Removing test files and unnecessary folders"
# rm -rf platforms/*/backend

echo "Creating new version of README for extension reviewer"
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
echo "tktrex is tiktok.tracking.exposed extension" >> README.md
echo "yttrex is youtube.tracking.exposed extension" >> README.md
echo "ycai is youchoose.ai extension" >> README.md
echo -e "## Extension reviewer TODOs\n\n" > TODO.md
echo -e 'Place the `trex.zip` in a folder an unzip it \n' >> TODO.md
echo -e "### Requirements\n" >> TODO.md
echo -e '- yarn `v3`\n - node `16` \n' >> TODO.md
echo -e "#### Installation \n" >> TODO.md
echo -e 'Install dependencies\n' >> TODO.md
echo -e '```bash\nyarn\n```\n' >> TODO.md
echo -e "tktrex is tiktok.tracking.exposed extension\n" >> TODO.md
echo -e '```bash\nyarn tk:ext dist\nls -l platforms/tktrex/extension/dist/*.zip\n```\n' >> TODO.md
echo -e "yttrex is youtube.tracking.exposed extension\n" >> TODO.md
echo -e '```bash\nyarn yt:ext dist\nls -l platforms/yttrex/extension/dist/*.zip\n```\n' >> TODO.md
echo -e "ycai is youchoose.ai extension\n" >> TODO.md
echo -e '```bash\nyarn ycai build\nls -l platforms/ycai/studio/build/extension/*.zip\n```\n' >> TODO.md

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

zip $fileout -r ./* \
.npmrc .nvmrc .yarn .yarnrc.yml \
.npmrc .nvmrc .yarn .yarnrc.yml \
-x "yarn.lock" \
-x ".yarn/unplugged/**" \
-x ".yarn/cache/**" \
Expand All @@ -56,12 +64,19 @@ zip $fileout -r ./* \
-x "**/__tests__/**" \
-x "docs/**" -x "**/docs/**" \
-x "coverage/**" -x "**/coverage/**" \
-x "downloads/**" -x "**/downloads/**" \
-x "logs/**" -x "**/logs/**" \
-x "docker/**" \
-x "build/**" -x "**/build/**" \
-x "scripts/**" -x "**/scripts/**" \
-x "packages/taboule/**" \
-x "platforms/guardoni/**" \
-x "platforms/tktrex/observatory/**" \
-x "platforms/tktrex/ua-observatory/**" \
-x "platforms/tktrex/tt-automate/**" \
-x "platforms/*/backend/**" \
-x "platforms/*/backend/**" \

zip $fileout scripts/install-from-shrinkzip.sh

rm README.md
mv .README.md README.md

echo "done!"

0 comments on commit ca80437

Please sign in to comment.