Below, replace <user> with your repository account name and <version> with the appropriate version of the app build.
You'll need to first get the code from GitHub and install the Node modules.
mkdir src
cd src
git clone https://github.com/<user>/iptimeclock.git
cd iptimeclock
npm install
The Node package used to build the app, electron-builder, requires the mksquashfs tool to create the application package on Linux (i.e. Raspbian), but doesn't currently come with a version compatible with the Raspberry Pi's arm7l architecture. So, you're going to have to build and install it yourself.
cd /usr/src
sudo git clone https://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git
cd squashfs-tools/squashfs-tools
sudo make install
This will have built and installed squashfs-tools. Now we need to manually create a symbolic link to mksquashfs in the electron-builder's cache.
mkdir -p ~/.cache/electron-builder/appimage/appimage-9.1.0/linux-arm
cd ~/.cache/electron-builder/appimage/appimage-9.1.0/linux-arm
ln -s /usr/local/bin/mksquashfs mksquashfs
The app's package.json contains a command for building and packaging the app, called "build".
npm run build
If you're also wanting to install the newly build and packaged app...
cp "dist/iptimeclock <version> arm7l.AppImage" ~/iptimeclock
./iptimeclock
The last line above will launch the app for the first time. The RPi will display a prompt, the buttons for which will not likely be visible - just hit Enter.
The application supports automatic updates using the electron-updater Node package. When making application changes, you'll need to follow the below steps to properly build, package, and deploy new releases for the updater to retrieve.
You'll need to ensure the package.json is configured with your GitHub repository name and that you have an environment variable set up with your GitHub API token.
"build": {
"publish": [
{
"provider": "github",
"owner": "<user>",
"repo": "iptimeclock"
}
],
- Create a personal access token on GitHub
- Assign this token to an environment variable named GH_TOKEN
- Raspberry Pi: add to .bashrc
export GH_TOKEN="\<token\>"
- Windows
- Raspberry Pi: add to .bashrc
- Modify the version number in package.json (recommend you use semantic versioning)
- On Windows, confirm the project builds successfully
npm run build
- Commit to Git and push to GitHub
- On Windows, build and publish to a draft release on GitHub
npm run publish
- On the Raspberry Pi, pull latest from the repo, build, and publish to the draft release
git pull npm run publish
- On GitHub, publish the draft release
FileZilla is an FTP/SFTP client and is used to transfer files between your computer to the RPi.