2021-12-10 23:19:15 +00:00
|
|
|
name: Release Nightly
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-12-10 23:25:28 +00:00
|
|
|
branches: [ main ]
|
2021-12-11 11:12:04 +00:00
|
|
|
paths:
|
|
|
|
- 'src/**'
|
|
|
|
- 'polyfills/**'
|
2021-12-11 11:26:47 +00:00
|
|
|
- '.github/workflows/release_nightly.yml'
|
2021-12-10 23:19:15 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup Node.js v16.x
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16.x
|
|
|
|
|
|
|
|
- name: NPM Install
|
2021-12-11 18:21:59 +00:00
|
|
|
run: |
|
|
|
|
cd src
|
2021-12-14 19:43:49 +00:00
|
|
|
npm i
|
2021-12-11 18:21:59 +00:00
|
|
|
cd ..
|
|
|
|
npm i -g asar uglify-js
|
2021-12-10 23:19:15 +00:00
|
|
|
|
2021-12-11 11:21:34 +00:00
|
|
|
- name: Pack base asar
|
2021-12-10 23:19:15 +00:00
|
|
|
run: |
|
2021-12-13 10:56:24 +00:00
|
|
|
node scripts/strip.js
|
2021-12-14 22:30:38 +00:00
|
|
|
rm src/splash/_splashScreen.rewrite.js
|
2021-12-13 10:56:24 +00:00
|
|
|
node scripts/injectPolyfills.js
|
2021-12-11 20:09:43 +00:00
|
|
|
sed -i -e "s/nightly/nightly-$(git rev-parse HEAD | cut -c 1-7)/" src/index.js
|
2021-12-11 18:21:59 +00:00
|
|
|
|
2021-12-14 23:03:26 +00:00
|
|
|
npx asar pack src app.asar
|
2021-12-10 23:19:15 +00:00
|
|
|
|
2021-12-14 22:54:35 +00:00
|
|
|
- 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
|
|
|
|
cp src/package.json .
|
2021-12-16 13:06:10 +00:00
|
|
|
cp src/splash/index.html .
|
|
|
|
cp src/splash/preload.js .
|
2021-12-14 22:54:35 +00:00
|
|
|
npx minify-json package.json
|
2021-12-14 23:03:26 +00:00
|
|
|
rm -rf src
|
|
|
|
mkdir src
|
2021-12-14 22:54:35 +00:00
|
|
|
cp index.js src
|
|
|
|
cp package.json src
|
2021-12-16 13:06:10 +00:00
|
|
|
cp index.html src
|
|
|
|
cp preload.js src
|
2021-12-16 12:59:52 +00:00
|
|
|
npx asar pack src testing.asar
|
2021-12-11 11:21:34 +00:00
|
|
|
|
2021-12-11 10:23:24 +00:00
|
|
|
- name: GitHub Release
|
|
|
|
run: |
|
|
|
|
gh release delete ${{ env.VERSION }} -y
|
2021-12-11 20:10:49 +00:00
|
|
|
gh release create ${{ env.VERSION }} -t "${{ env.NAME }}" -n "${{ env.BODY }}" ${{ env.FILES }}
|
2021-12-11 10:23:24 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
VERSION: 'nightly'
|
|
|
|
NAME: 'Nightly'
|
2021-12-11 16:02:44 +00:00
|
|
|
BODY: Latest Nightly release
|
2021-12-16 12:59:52 +00:00
|
|
|
FILES: app.asar testing.asar
|
|
|
|
# FILES: app.asar
|