62 lines
No EOL
1.6 KiB
YAML
62 lines
No EOL
1.6 KiB
YAML
name: Release Nightly
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'src/**'
|
|
- 'polyfills/**'
|
|
- '.github/workflows/release_nightly.yml'
|
|
|
|
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
|
|
run: |
|
|
cd src
|
|
npm i
|
|
cd ..
|
|
npm i -g asar uglify-js
|
|
|
|
- name: Pack base asar
|
|
run: |
|
|
node scripts/strip.js
|
|
node scripts/injectPolyfills.js
|
|
sed -i -e "s/nightly/nightly-$(git rev-parse HEAD | cut -c 1-7)/" src/index.js
|
|
|
|
npx asar pack src app.asar
|
|
|
|
# - 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 .
|
|
# npx minify-json package.json
|
|
# rm -rf src/*
|
|
# cp index.js src
|
|
# cp package.json src
|
|
# npx asar pack src minified.asar
|
|
|
|
- name: GitHub Release
|
|
run: |
|
|
gh release delete ${{ env.VERSION }} -y
|
|
gh release create ${{ env.VERSION }} -t "${{ env.NAME }}" -n "${{ env.BODY }}" ${{ env.FILES }}
|
|
env:
|
|
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
|
VERSION: 'nightly'
|
|
NAME: 'Nightly'
|
|
FILES: app.asar
|
|
BODY: Latest Nightly release
|
|
# FILES: app.asar minified.asar |