Skip to content

Build Desktop App

Build Desktop App #34

Workflow file for this run

name: Build Desktop Apps
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag to build/upload (e.g. v1.4.8)'
required: true
type: string
publish_release:
description: 'Publish the GitHub Release (default: create a draft so we can validate before shipping)'
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build Windows
run: npm run build:win -- --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: |
dist/*.exe
dist/*.exe.blockmap
dist/latest.yml
if-no-files-found: error
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build macOS
run: npm run build:mac -- --publish never
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: macos-installer
path: |
dist/*.dmg
dist/*.dmg.blockmap
dist/*-mac.zip
dist/*-mac.zip.blockmap
dist/latest-mac.yml
if-no-files-found: error
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build Linux
run: npm run build:linux -- --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: linux-installer
path: |
dist/*.AppImage
dist/*.deb
dist/*.rpm
dist/latest-linux.yml
if-no-files-found: error
create-release:
needs: [build-windows, build-macos, build-linux]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create / Update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}
draft: ${{ !(github.event_name == 'workflow_dispatch' && inputs.publish_release == true) }}
fail_on_unmatched_files: true
generate_release_notes: true
files: |
windows-installer/*.exe
windows-installer/*.exe.blockmap
windows-installer/latest.yml
macos-installer/*.dmg
macos-installer/*.dmg.blockmap
macos-installer/*-mac.zip
macos-installer/*-mac.zip.blockmap
macos-installer/latest-mac.yml
linux-installer/*.AppImage
linux-installer/*.deb
linux-installer/*.rpm
linux-installer/latest-linux.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}