Skip to content

electron simplest hello world app ever

Notifications You must be signed in to change notification settings

daggerok/my-electro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my electro

Quick electron getting started guide...

create

mkdir my-electro
cd my-electro
npm init -y
npm i -ED electron
touch index.html
touch main.js # app main entry point

update

your package.json file:

{
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  }
}

run

npm start

release

build

install packager

npm i -ED electron-packager

add scripts

vi package.json
{
  "scripts": {
    "start": "electron .",
    "build": "npm-run-all package:*",
    "package:mac": "  electron-packager . electron-tutorial-app --overwrite --asar --platform=darwin --arch=x64 --prune=true --out=dist  --version-string.CompanyName=daggerok --version-string.FileDescription=UA --version-string.ProductName=\"MyElectro\"",
    "package:linux": "electron-packager . electron-tutorial-app --overwrite --asar --platform=linux  --arch=x64 --prune=true --out=dist  --version-string.CompanyName=daggerok --version-string.FileDescription=UA --version-string.ProductName=\"MyElectro\""
    "zip": "for i in `ls dist` ; do zip -d dist/$i > dist/$i.zip ; done"
  }
}

build apps

npm run build

package apps

npm run zip

test archives

unzip dist/electron-tutorial-app-darwin-x64.zip -d dist/app  

prepare

git add .
git commit -am ...

perform using node

npm version patch
#npm version patch -m "Message..."
git push origin --tags

perform using github-release.sh script

GITHUB_TOKEN=abcd123... ./github-release.sh "Message..."
## or:
# ./github-release.sh "Message..." abcd123...