To get started, install the project dependencies with:
yarn install # or npm install
Run the electron project with:
yarn electron:serve # or npm run electron:serve
❗ The project artifacts are built automatically when a new tag is pushed!
There is no need to build the app on different OSs manually. When a new tag starting with "v" is pushed, a Github Action builds the artifacts for all platform. These artifacts still need to manually be included in the release "assets". More information at https://github.com/belvederef/visual-snow-relief-overlay/blob/main/.github/workflows/build.yml.
You can only build the files from the respective OSs. Unless you own such systems, to deploy use a Docker container for Windows and a VM for Mac.
For new versions, bump up the version number in package.json
.
To build the package for Windows:
docker run --rm -ti \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v ${PWD}:/project \
-v ${PWD##*/}-node-modules:/project/node_modules \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine
Once inside the container:
yarn
yarn electron:generate-icons
yarn electron:publish -w # or yarn electron:build -w to build only
chown -R `stat -c "%u:%g" ./build` ./build # change ownership of built files (e.g. icons) created in the Docker container
chown -R `stat -c "%u:%g" ./dist_electron` ./dist_electron # change ownership of the dist files created in the Docker container
You need Virtualbox on your machine. Run the automated script you find at https://github.com/myspaghetti/macos-virtualbox to create a macOs VM. Depending on the CPU you have, it might error and halt at some point, from which you will have to select a different cpu profile. For a Ryzen 5, this works:
VBoxManage modifyvm "macOS" --cpu-profile "Intel Xeon X5482 3.20GHz"
After the VM boots, continue the script.
To build, use:
yarn electron:generate-icons
yarn electron:publish -m # or yarn electron:build -m to build only
Docker linux container:
docker run --rm -ti \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v ${PWD}:/project \
-v ${PWD##*/}-node-modules:/project/node_modules \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:14
In a linux environment, simply run:
yarn electron:generate-icons
yarn electron:publish -l # or yarn electron:build -l to build only