Package for distribution #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package for distribution | |
on: workflow_dispatch | |
env: | |
CSC_IDENTITY_AUTO_DISCOVERY: false | |
jobs: | |
package: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-20.04, macos-latest] | |
# OS-specific commands/variables | |
include: | |
- os: ubuntu-20.04 | |
cmd_package: npm run package-linux | |
out_filename: Bob-linux | |
- os: windows-latest | |
cmd_package: npm run package-win | |
out_filename: Bob-windows | |
- os: macos-latest | |
cmd_package: npm run package-mac | |
out_filename: Bob-macos-intel | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
# https://github.com/actions/setup-node/issues/280#issuecomment-1139455898 | |
- name: Update node-gyp (windows only) | |
if: startsWith(matrix.os, 'windows') | |
run: | | |
$WhereNode = Get-Command node | Select-Object -ExpandProperty Definition | |
$NodeDirPath = Split-Path $WhereNode -Parent | |
$NodeModulesPath = $NodeDirPath + "\node_modules\npm\node_modules\@npmcli\run-script" | |
cd $NodeModulesPath | |
npm install node-gyp@latest | |
- name: Install dependencies (linux only) | |
if: startsWith(matrix.os, 'ubuntu') | |
run: sudo apt update && sudo apt install libudev-dev libusb-1.0-0-dev -y | |
- name: Install npm packages | |
run: npm i | |
- name: Install dmg-license (macos only) | |
if: startsWith(matrix.os, 'macos') | |
run: npm i dmg-license --no-save | |
- name: Generate Executable | |
run: ${{ matrix.cmd_package }} | |
- name: Store artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.out_filename }} | |
path: | | |
release/*.AppImage | |
release/*.msi | |
release/*.dmg |