Skip to content

Commit

Permalink
feat: automated packaging script
Browse files Browse the repository at this point in the history
  • Loading branch information
alex4401 committed Aug 17, 2023
1 parent 0ebd1ee commit 0fea9a8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"private": true,
"scripts": {
"build": "rollup -c rollup-config-background.mjs",
"package-dev": "zip -r Generic_Chrome_N.N.N-devN.zip manifest.json built icons popup.html sites.json"
"package-dev": "zip -r Generic_Chrome_N.N.N-devN.zip manifest.json built icons popup.html sites.json",
"package-release": "bash scripts/package_release.sh"
},
"devDependencies": {
"@rollup/plugin-json": "^6.0.0",
Expand Down
23 changes: 23 additions & 0 deletions scripts/package_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

FILE_LIST='built icons popup.html sites.json'

function _package_for() {
echo "PACKAGING EXTENSION FOR TARGET ${1^^}"

MANIFEST="manifest_$1.json"
VERSION=`cat $MANIFEST | jq -r '.version'`
TARBALL="pkgs/Generic_${1^}_$VERSION-rel1.zip"
echo "MANIFEST: $MANIFEST"
echo "VERSION: $VERSION"
echo "OUTPUT: $TARBALL"

zip -r $TARBALL $FILE_LIST $MANIFEST
7za rn $TARBALL $MANIFEST manifest.json
}


npm run build
for target in chrome firefox; do
_package_for $target
done

0 comments on commit 0fea9a8

Please sign in to comment.