Skip to content

Build desktop app & publish it to github release #26

Build desktop app & publish it to github release

Build desktop app & publish it to github release #26

name: Build desktop app & publish it to github release
on:
workflow_dispatch:
push:
tags:
- v*
jobs:
publish:
name: Build (${{ matrix.os }} - ${{ matrix.arch }})
permissions:
contents: write
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Build for supported platforms
# https://github.com/electron/electron-packager/blob/ebcbd439ff3e0f6f92fa880ff28a8670a9bcf2ab/src/targets.js#L9
# 32-bit Linux unsupported as of 2019: https://www.electronjs.org/blog/linux-32bit-support
os: [ubuntu-latest, windows-latest]
arch: [x64]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install linux deps
run: |
sudo apt update && sudo apt install -y flatpak flatpak-builder elfutils
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
sudo flatpak install --runtime flathub org.freedesktop.Platform/x86_64/22.08
sudo flatpak install flathub org.electronjs.Electron2.BaseApp//22.08
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Install
run: npm ci
- name: Release
run: npm run publish:desktop -- --arch=${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}