Skip to content

Chore/test ci

Chore/test ci #16

Workflow file for this run

name: 🛠️ Desktop CI
on:
pull_request:
branches:
- main
paths:
- 'apps/desktop/**'
- '.github/workflows/desktop-build.yml'
- '.github/workflows/mildstack-release.yml'
permissions:
contents: read
concurrency:
group: desktop-ci-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
build-cli:
name: Build CLI Binaries
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26.2'
cache: true
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12
cache: 'npm'
cache-dependency-path: apps/desktop/package-lock.json
- name: Install dependencies
working-directory: apps/desktop
run: npm ci --prefer-offline
env:
npm_config_fetch_retries: 5
npm_config_fetch_retry_mintimeout: 20000
npm_config_fetch_retry_maxtimeout: 120000
- name: Build Go CLI binaries
working-directory: apps/desktop
run: npm run build:cli
- name: Upload CLI artifacts
uses: actions/upload-artifact@v4
with:
name: ci-cli-binaries
path: apps/desktop/resources/bin/
if-no-files-found: error
retention-days: 3
build-desktop:
name: Build Desktop (${{ matrix.label }})
needs: build-cli
runs-on: ${{ matrix.os }}
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
label: macOS
platform: mac
- os: windows-latest
label: Windows
platform: win
- os: ubuntu-latest
label: Linux
platform: linux
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12
cache: 'npm'
cache-dependency-path: apps/desktop/package-lock.json
- name: Install dependencies
working-directory: apps/desktop
run: npm ci --prefer-offline
env:
npm_config_fetch_retries: 5
npm_config_fetch_retry_mintimeout: 20000
npm_config_fetch_retry_maxtimeout: 120000
- name: Download CLI artifacts
uses: actions/download-artifact@v4
with:
name: ci-cli-binaries
path: apps/desktop/resources/bin/
- name: Make binaries executable
if: runner.os != 'Windows'
run: find apps/desktop/resources/bin -type f -exec chmod +x {} +
- name: Clean dist directory
shell: bash
run: rm -rf apps/desktop/dist
- name: Build Electron app source
working-directory: apps/desktop
run: npm run build
env:
NODE_OPTIONS: '--max-old-space-size=8192'
- name: Build Electron app
working-directory: apps/desktop
run: npx --no-install electron-builder --${{ matrix.platform }} --publish never
env:
NODE_OPTIONS: '--max-old-space-size=8192'