diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 2751884..19a36b8 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -40,18 +40,8 @@ jobs: - name: Pack minified asar run: | - npm i -g esbuild uglify-js minify-json - npx esbuild ./src --bundle --platform=node --external:electron --external:original-fs --external:auto-updater --outfile=index.js - npx uglifyjs --compress --mangle -o index.js -- index.js - npx uglifyjs --compress --mangle -o preload.js -- src/splash/preload.js - npx uglifyjs --compress --mangle -o mainWindowInject.js -- src/mainWindowInject.js - cp src/package.json . - cp src/splash/index.html . - npx minify-json package.json - rm -rf src - mkdir src - cp index.js package.json index.html preload.js mainWindowInject.js src - npx asar pack src testing_dont_use.asar + npm i -g esbuild uglify-js minify-json html-minifier + bash scripts/minify.sh - name: GitHub Release run: | @@ -66,5 +56,5 @@ jobs: VERSION: 'nightly' NAME: 'Nightly' BODY: Latest Nightly release - FILES: app.asar testing_dont_use.asar + FILES: app.asar minified.asar # FILES: app.asar \ No newline at end of file diff --git a/scripts/minify.sh b/scripts/minify.sh new file mode 100755 index 0000000..3db285a --- /dev/null +++ b/scripts/minify.sh @@ -0,0 +1,14 @@ +#!/bin/sh +rm -rf miniSrc +mkdir miniSrc +npx esbuild ./src --bundle --platform=node --external:electron --external:original-fs --external:auto-updater --outfile=miniSrc/index.js +npx esbuild ./src/splash/preload.js --bundle --platform=node --external:electron --external:original-fs --external:auto-updater --outfile=miniSrc/preload.js +npx uglifyjs --compress --mangle -o miniSrc/index.js -- miniSrc/index.js +npx uglifyjs --compress --mangle -o miniSrc/preload.js -- miniSrc/preload.js +npx uglifyjs --compress --mangle -o miniSrc/mainWindowInject.js -- src/mainWindowInject.js +npx html-minifier --collapse-whitespace --remove-comments --remove-script-type-attributes --remove-tag-whitespace --minify-css true --minify-js true -o miniSrc/index.html -- src/splash/index.html +# cp src/splash/index.html miniSrc/ +cp src/package.json miniSrc/package.json +npx minify-json miniSrc/package.json +npx asar pack miniSrc minified.asar +# rm -rf miniSrc \ No newline at end of file