2024-04-19 06:06:08 -07:00
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name : Node.js CI
on :
push :
branches : [ "master" ]
pull_request :
branches : [ "master" ]
jobs :
Build-for-linux :
name : Run npm on Ubuntu
runs-on : ubuntu-latest
2024-04-19 06:08:24 -07:00
defaults :
run :
working-directory : 'UI' # Here the path to the folder where package-lock.json is located.
2024-04-19 06:06:08 -07:00
steps :
- uses : actions/checkout@v4
- uses : awalsh128/cache-apt-pkgs-action@latest
with :
packages : libusb-1.0-0 libusb-1.0-0-dev libudev-dev
version : 1.0
- name : Setup Node
2024-04-29 21:15:16 -07:00
uses : actions/setup-node@v4
2024-04-19 06:06:08 -07:00
with :
node-version : '19.x'
- name : Install Electron and build
run : |
2024-05-15 21:17:49 -07:00
npm install @electron/rebuild -g
2024-04-19 06:06:08 -07:00
npm install electron-builder -g
npm install
npm run package-linux-workflow
- name : Save .appimage as artefact
uses : actions/upload-artifact@v4
with :
2024-04-29 21:15:16 -07:00
name : Ardu-Stim linux
2024-04-19 06:13:29 -07:00
path : UI/dist/*.AppImage
2024-04-19 06:06:08 -07:00
2024-04-29 21:15:16 -07:00
Build-for-mac-x86_64 :
name : Run npm on x86_64 macos
2024-04-29 21:40:06 -07:00
runs-on : macos-12 #As of Apr 2024 macos-12 will give an intel host and macos-14 will be aarm64
2024-04-19 06:08:24 -07:00
defaults :
run :
working-directory : 'UI' # Here the path to the folder where package-lock.json is located.
2024-04-19 06:06:08 -07:00
steps :
- uses : actions/checkout@v4
- name : Setup Node, Electron and built
2024-04-29 21:15:16 -07:00
uses : actions/setup-node@v4
2024-04-19 06:06:08 -07:00
with :
node-version : '19.x'
- name : Install Electron and build
run : |
python3 -m pip install setuptools
2024-05-15 21:17:49 -07:00
npm install @electron/rebuild -g
2024-04-19 06:06:08 -07:00
npm install electron-builder -g
npm install
npm run package-mac-workflow
- name : Save .dmg as artefact
uses : actions/upload-artifact@v4
with :
2024-04-29 21:15:16 -07:00
name : Ardu-Stim Mac-x86_64
path : UI/dist/*.dmg
2024-05-15 21:17:49 -07:00
# This build does NOT work. macos-14 arm64 makes code signing mandatory and applications built on it without signing will report as 'damaged'. See: https://github.com/electron-userland/electron-builder/issues/7602
2024-04-29 21:15:16 -07:00
Build-for-mac-arm64 :
2024-05-15 21:17:49 -07:00
if : false #Disables this job. See note above.
2024-04-29 21:15:16 -07:00
name : Run npm on arm64 macos
runs-on : macos-14 #As of Apr 2024 macos-13 will give an intel host and macos-14 will be aarm64
defaults :
run :
working-directory : 'UI' # Here the path to the folder where package-lock.json is located.
steps :
- uses : actions/checkout@v4
- name : Setup Node, Electron and built
uses : actions/setup-node@v4
with :
node-version : '19.x'
- name : Install Electron and build
run : |
2024-04-29 21:53:07 -07:00
brew install python-setuptools
2024-05-15 21:17:49 -07:00
npm install @electron/rebuild -g
2024-04-29 21:15:16 -07:00
npm install electron-builder -g
npm install
npm run package-mac-workflow
- name : Save .dmg as artefact
uses : actions/upload-artifact@v4
with :
name : Ardu-Stim Mac-arm64
2024-04-19 06:13:29 -07:00
path : UI/dist/*.dmg
2024-04-19 06:06:08 -07:00
Build-for-win :
name : Run npm on x64 Windows
runs-on : windows-latest
2024-04-19 06:08:24 -07:00
defaults :
run :
working-directory : 'UI' # Here the path to the folder where package-lock.json is located.
2024-04-19 06:06:08 -07:00
steps :
- uses : actions/checkout@v4
- name : Setup Node, Electron and built
2024-04-29 21:15:16 -07:00
uses : actions/setup-node@v4
2024-04-19 06:06:08 -07:00
with :
node-version : '19.x'
- name : Install Electron and build
run : |
2024-05-15 21:17:49 -07:00
npm install @electron/rebuild -g
2024-04-19 06:06:08 -07:00
npm install electron-builder -g
npm install
npm run package-win
- name : Save .exe as artefact
uses : actions/upload-artifact@v4
with :
2024-04-29 21:15:16 -07:00
name : Ardu-Stim Win 64
2024-04-19 06:13:29 -07:00
path : UI/dist/*.exe